Declaration and Initialization
char name[] = "John";
char name[5] = "John";
char name[] = { 'J', 'o', 'h', 'n', '\0'};
char name[5] = { 'J', 'o', 'h', 'n', '\0'};
#include <stdio.h>
int main () {
char name[5] = {'J', 'o', 'h', 'n', '\0'};
printf("My name is: %s\n", name );
return 0;
}
0 Comments