I’m not used to C as I’m primarily a Java guy, with some knowledge of C++, so forgive me if this is a trivial question. I could not seem to find an answer while searching online.
I’m initializing a char array…
char tcp[50];
So that I can concatenate a const char and a char. In examples I saw an easy way to do this was by creating that empty char array and then using…
strcat(x,y);
To stick them together.
Problem is, printing out the blank char array when it is set to “50” gives me a result of:
X??|?
When I change it to…
char tcp[100];
And print it, its blank. Why is this?
The array contents are undefined, assuming it is a local (automatic) array.
Use:
Or:
Or:
Or:
As you like.