char str["hello"char ch ' ' \ end of string beginning of string here is character not string the character requires only one memory location char str[" "char str["" \ \ here is string not character the string requires two memory locations one to store the character and another to store the null character empty string although permits empty stringit does not allow an empty character figure difference between character storage and string storage str str[ str[ str[ str[ str[ \ figure memory representation of character array programming tip when allocating memory space for stringreserve space to hold the null character also like we use subscripts (also known as indexto access the elements of an arraywe can also use subscripts to access the elements of string the subscript starts with zero ( all the characters of string are stored in successive memory locations figure shows how str[is stored in the memory thusin simple termsa string is sequence of characters in fig etc are the memory addresses of individual characters for simplicitythe figure shows that is stored at memory location but in realitythe ascii code of character is stored in the memory and not the character itself soat address will be stored as the ascii code for is the statement char str["hello"declares constant stringas we have assigned value to it while declaring the string howeverthe general form of declaring string is char str[size]when we declare the string like thiswe can store size- characters in the array because the last character would be the null character for examplechar mesg[ ]can store maximum of characters till nowwe have only seen one way of initializing strings the other way to initialize string is to initialize it as an array of characters for examplechar str[{' '' '' '' '' ''\ '}in this examplewe have explicitly added the null character also observe that we have not mentioned the size of the string herethe compiler will automatically calculate the size based on the number of characters soin this example six memory locations will be reserved to store the string variablestr we can also declare string with size much larger than the number of elements that are initialized for exampleconsider the statement below char str [ "hello"