Create a string variable with proper example.
Answers
Answered by
12
Answer:
The classic Declaration of strings can be done as follow: char string_name[string_length] = "string"; The size of an array must be defined while declaring a C String variable because it is used to calculate how many characters are going to be stored inside the string variable in C.
Answered by
19
→Answers :
→String variables, simply speaking, are variables that contain not just numbers, but also other characters (possibly mixed with numbers).
→Examples :
→For example, the variables GALLONS and MILES in the previous program are numerical variables.
→For example, the word "hamburger" and the phrase "I ate 3 hamburgers" are both strings.
Similar questions