Jump to content

character arrays in C

- - - - -

  • Please log in to reply
1 reply to this topic

#1
onus

onus

    Programmer

  • Members
  • PipPipPipPip
  • 115 posts
I was reading Kernighan Ritchie book chapter 4 which deals with character pointers.
I am not able to understand following different type of declarations

char aname[][15] = { "Illegal month", "Jan", "Feb", "Mar" };

char amessage[] = "now is the time"; 

char *name[] = { "Illegal month", "Jan", "Feb", "Mar" };



#2
vachovsky

vachovsky

    Newbie

  • Members
  • Pip
  • 8 posts
at the first line: pointer to pointer to array, which should contain a C string. ( fixed size )
at the next line: pointer to array , which should contain a C string.
at the last line: pointer to pointer




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users