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 character constants represent numerical values?
What is a structure member in c?
How we can insert comments in a c program?
Explain how do you determine a file’s attributes?
What is string function in c?
What is the use of #include in c?
What are the types of operators in c?
Explain what does the function toupper() do?
#include
What are the different file extensions involved when programming in C?
What does 1f stand for?
How can I find the modification date and time of a file?
What does stand for?
differentiate built-in functions and user – defined functions.
Explain bit masking in c?