You are not logged in.
I have the folowing array:
char *message = "hello";
or
char message[] = "hello";
How to split the array/string in its characters (char message [0] = "h", etc)?
Offline
Hi,
I'm not sure if I understand you correctly. But a string/array of characters is already split in its characters.
char m[] = "Hello";
char c;
m[1] = 'E';
printf("%sn",m); // HEllo
c = m[2];
printf("%cn",c); // l
Offline
Hi,
I'm not sure if I understand you correctly. But a string/array of characters is already split in its characters.char m[] = "Hello"; char c; m[1] = 'E'; printf("%sn",m); // HEllo c = m[2]; printf("%cn",c); // l
I did this like you but I use %s instead of %c so it couldn't work. But thanks for helping me.
Offline