Hello
I have a char array that I need to get together to form a String.Is this possible?
I just have 3 char arrays
char[0] which holds an "O"
char[1] which holds a "K"
char[2] wich holds a "1"
I would like to my final String be "OK1" for the use on if cicles
Can someone give me a tip?
First, you need to understand that string (a NULL terminated array of chars) and String are two completely different things. Which is it you want?
If you are smart, you want a string, which means that you simply need to NULL terminate the array that you already have, and are populating. The numero array, though, is not big enough to hold the NULL, so you need to make it one element bigger. On a second reading of your code, I see that you are currently putting 13 values in your 12 element array, so you need to make it 2 larger.
hello PaulS
Thanks it finaly works fine
All I need was add the end of string on each array and now I can print it
On a second reading of your code, I see that you are currently putting 13 values in your 12 element array, so you need to make it 2 larger.
I think you are wrong since array[0] position is also included so my size is fine.All I need was add an extra element to put the end of string
thanks very much for your help, it really save me lots of time.