#include <stdio.h>
int main(void) {
char ar[] = {"a","b","c","d","e","f","/0"};
printf("%s\n", ar);
return 0;
}
I wrote it like this In Visual Studio, "You cannot initialize an entity in the "char *" format using a value in the "const char *" format," and when I turned on the code executor, the original abcdef was supposed to come out, but only a came out. This is language c. Please help me
array c visual-studio
1 character in c must be enclosed in '', not ''.
And your character representation is also \0, not /0.
Please modify it as below and try it.
char ar[] = {'a','b','c','d','e','f', '\0'};
© 2024 OneMinuteCode. All rights reserved.