Initializing
Syntax: char array_name[max_size + 1];
Example: char my_string[11];
Initialization:
char my_string[81] = “hello world”;
char my_string[ ] = “hello world”;
Note that
char my_string[ ] = “abc”;
and
char my_string[ ] = {‘a’,’b’,’c’};
are not equivalent!!!
Previous slide
Next slide
Back to first slide
View graphic version