Ask your own question, for FREE!
Computer Science 14 Online
OpenStudy (anonymous):

A C programming question :- a string can be declared as either char a[ ] = "Mystring" char *a = "Mystring" an array of strings char *a[ ] = {Some strings} why doesn't this work ? char a[ ][ ] = {Some strings}

OpenStudy (anonymous):

it works :P why do you think it doesn't?

OpenStudy (rsmith6559):

a is being declared as a two dimensional array of char. It's being initialized with one dimension. a[0] = {Some strings} would be more proper, except that, if I remember correctly, the size of the first index HAS to have a value in the declaration.

OpenStudy (anonymous):

bcoz its two dimensional array cant be declare in single dimension

OpenStudy (anonymous):

sry i mean single blocks

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!