I have get error with the following code and i can’t figure it out.
char name[]="tolgahan"
char result[100]="";
strncat(result,name[1],1);
I guess, i need to convert name[1] to string format but i don’t now how can i do that.
Please help me.
Best regards.
Try:
or
Explanation: A string in C is just the address (in memory) of the first character in a sequence of characters. So if you take the pointer (using the & operator or by adding 1 to the initial pointer), you get a string starting at the 2nd character of the initial string.