1

Hey guys so I'll cut this short. A few weeks ago I started learning the programming language C. I have knowledge in web technologies like HMTL/CSS, Javscript, PHP, and basic server administration. However this C language is just confusing as hell!!! To my understanding the C language does not have a data type for strings just characters, however I may be wrong. So this is my question regarding string in C.

Question: I have heard there are two ways of declaring a string. What is the difference between these two lines of declaring a string: a.) char stringName[]; b.) char *stringName;

I get that "char stringName[];" is an array of characters. However the second line confuses me. To my understanding the second line makes a pointer variable. Aren't pointer variables supposed to be the memory address of another variable? If someone can clarify this for me it would be greatly appreciated.

0 Answers0