Pointers and Arrays in C - Extremely confused -


this question has answer here:

i have learned traditional way of declaring character array follows:

char c[] = "john"; 

however, have noticed can declare as:

char *c = "john"; 

how work? know has pointers, please elaborate? appreciated.

in first example, c array of char. in:

 char *c = "john"; 

c here not array pointer (type char *) string literal. pointers , arrays different types in c.

below link if want learn pointers , arrays:

http://www.torek.net/torek/c/pa.html


Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -