Answer Posted / himaja
n C language, strings are stored in an array of char type along with the null terminating character "\0" at the end. In other words to create a string in C you create an array of chars and set each element in the array to a char value that makes up the string. When sizing the string array you need to add plus one to the actual size of the string to make space for the null terminating character, "\0"
Syntax to declare a string in C:
Sample Code
char fname[4];
| Is This Answer Correct ? | 4 Yes | 2 No |
Post New Answer View All Answers
Is c still relevant?
What are the 5 elements of structure?
What does %c mean in c?
What is calloc() function?
What is the value of h?
What is the use of ?
When should a far pointer be used?
Can you define which header file to include at compile time?
Where local variables are stored in c?
What is difference between far and near pointers?
What are the functions to open and close the file in c language?
What is a macro?
Is c easy to learn?
What is difference between structure and union with example?
Which built-in library function can be used to match a patter from the string?