Are these the same?

Are the following two declarations the same?

char city[] = {'D', 'a', 'l', 'l', 'a', 's'};
char city[] = "Dallas";
the first one
char city[] = {'D', 'a', 'l', 'l', 'a', 's'};
will just be a character array as there is no \0 at the end
and
char city[] = "Dallas";
can be said to be a c style string

if you put char
char city[] = {'D', 'a', 'l', 'l', 'a', 's','\0'};
then both will be same
Topic archived. No new replies allowed.