4330704 Lecture Notes - Lecture 2: Scanf Format String, Substring, Computer Engineering
Document Summary
Basically string is a character array but there is a slight difference between char array and string. Char array are not terminated by null but string automatically terminates by null. String is also defined as number of characters written in double quotation mark. Each string is terminated by the null ( \0") character, which indicates end of string. The null character is automatically appended to the end of the characters in a string constant when they are stored. Alphabets: lower case: a to z, upper case: a to z. Special character: +, -, *, /, %, {}, [], (), , " etc. Declaration and initialization in string: char my_string [] = computer ; //creates an array my_string[] = { c", o", m", p", u", t", Here it will store in memory as: c m p u t e r. Here it will store in memory as: a b c.