I have a char array that is partially filled with text and I want to convert an int to char and append to end of current text in the buffer. Is there a simple command to do this instead of converting int into another buffer and using strcat?
char buffer[100] = {"Something already there ="};
int number = 16;
//buffer=buffer+str(number)
// results in buffer containing "Something already there =16"
Thanks michael_x,
I had almost got there with itoa(x,chrBuffer[strlen(chrBuffer)],10); and wondering how to convert char to char* (I really don't get C programming with pointers).
Next question is how to append a space character?
I really think you should take the time and learn to understand the pointers. They are absolutely crucial in the C/C++ programming. And it's not that hard to learn really.
... the difference between char and char* is related to the difference between
'a' and "a" .
I understand the principal of pointers but it's the syntax that gets me.
I changed my code to use ' instead of " and it works but what is the special meaning of ' compared to " in C++
Also the arduino reference does not seem to mention little nuggets like itoa() and dtostrf(). Omissions like that steepens the learning curve.