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
Do array subscripts always start with zero?
What is the scope of local variable in c?
State the difference between x3 and x[3].
What are keywords c?
What are the loops in c?
Write a program to find factorial of a number using recursive function.
any function have arguments one or more OR not . it is compulsary a) any function compulsary have one or more arguments b) any function did not have arguments. It is not compulsary c) it is optional it is not compulsary d) none of the above
How is a structure member accessed?
What is a void pointer in c?
What is getch c?
In C language what is a 'dangling pointer'?
What are loops in c?
formula to convert 2500mmh2o into m3/hr
How do you define a string?
Is there any possibility to create customized header file with c programming language?