Skip to main content

Questions tagged [c-string]

A "C string" is an array of characters that ends with a 0 (null character) byte. The array, not any pointer, is the string.

1 vote
1 answer
1k views

I have to handle a String coming in over UART containing a bunch of information, part of it is a MAC-address that I get by using String.substring(a, b) returning a 12-char String representing a mac-...
Harald Lesan's user avatar
1 vote
2 answers
493 views

I am trying to write my own Arduino library and I would like to make it useful not just for ESP32/ESP8266 boards but also with Arduino boards. I have created my header file like this test.cpp #...
Mark Estrada's user avatar
0 votes
2 answers
856 views

I am newbie in Arduino and writing a program where I want to control the flow by using Serial monitor input (PI controller). I've read that using String() although easier it is slower than using char. ...
Ognyan Petkov's user avatar
0 votes
1 answer
196 views

I want to extract the file name MyFile.txt out of a path which is stored in a string "C:\\MyDirectory\\MyFile.txt"; I found a simple c code which does the job. string filename = "C:\\...
Santhosh Dhaipule Chandrakanth's user avatar
12 votes
6 answers
5k views

I've been reading a lot over the years why we should not use the notorious String class and how heap fragmentation is bad practice and not professional and we should never use it in our programs or we'...
Nino's user avatar
  • 411
0 votes
1 answer
1k views

I'm getting a bit tripped up on const char pointers lately. I'm getting a message from a server that comes through as either a c style string, a standard library string, or a WString: I'm sending down ...
Chris Schmitz's user avatar
1 vote
2 answers
1k views

I have following function for my Arduino: String readLine() { String received = ""; char ch; while (myFile.available()) { ch = myFile.read(); if (ch == '\n' or ch == '\r') { ...
sharkyenergy's user avatar
0 votes
1 answer
81 views

For the below code snippet const char* fr_fbdb(char tag[30]) // fn for retrieving data { char full_path[120]; const char *_dt ; strcpy(full_path , base_path); strcat(full_path , tag); ...
Somasundharam Sampath's user avatar
-1 votes
1 answer
1k views

I have a mobile app (done using MIT App Inventor) storing some values to a Firebase database. App inventor stores all the values as strings (i.e. with quotes, and strings have quotes enclosed within ...
Somasundharam Sampath's user avatar
1 vote
2 answers
3k views

I'm trying to compare a char array that I'm assembling to a string and I'm having trouble comparing the strings. I'm getting the data for the char array as a set of bytes and I'm compiling it into a ...
Chris Schmitz's user avatar
0 votes
1 answer
450 views

I don't understand why the formatted string is displaying ?? instead of float values. My code: #include <Arduino.h> #include <Wire.h> #include "SparkFunCCS811.h" #include <...
Zaffresky's user avatar
  • 183
1 vote
2 answers
11k views

I have a string that looks like this "10.00,20.00,-50.00," in which these are angle values and they have 2 decimals and can be negative. I want to separate them into 3 separate floats. Here ...
DragonflyRobotics's user avatar
1 vote
0 answers
602 views

I know this is Arduino Forum but I think this question is related to programming, I am using ESP8266 for the project. I need to convert the string incoming on the serial through UART lines and ...
Naren2312's user avatar
0 votes
1 answer
70 views

I am trying to write a function to store the date and time data from an RTC module. I have used char arrays to implement the function. I get "declaration of 'varDay' as array of references" ...
Zaffresky's user avatar
  • 183
0 votes
2 answers
628 views

I know it's bad to use Strings due to the memory problems that can occur. I've tried to remove all instances of strings from my code. But I'm not sure about this line: http.getString().toCharArray(...
David Klempfner's user avatar

15 30 50 per page