what is difference between array of characters and string
Answer Posted / kapil kumar verma iimt meerut
when we declare array of char it has to be terminated by
null but termination by null in case of string is
automatic.the compiler automatically puts a null char when
we insert a string for example "kapil" for the
string "kapil\0", but for a char array we need assign a
place for it for example a[6] contains five char & a null
char.& secondly
when char array is read through scanf() input function then
spaces are not allowed if characters is read as string
(through gets() function) spaces are allowedand are treated
as a single char.
| Is This Answer Correct ? | 38 Yes | 4 No |
Post New Answer View All Answers
how to construct a simulator keeping the logical boolean gates in c
What is #ifdef ? What is its application?
What do you mean by command line argument?
Can we add pointers together?
What is the difference between struct and typedef struct in c?
exit () is used to a) exit () terminates the execution of the program itself b) exit () terminates the execution of the loop c) exit () terminates the execution of the block d) none of the above
What are qualifiers?
What is the difference between test design and test case design?
why do some people write if(0 == x) instead of if(x == 0)?
Differentiate call by value and call by reference?
Explain how do I determine whether a character is numeric, alphabetic, and so on?
c program to compute AREA under integral
How can you call a function, given its name as a string?
Where are local variables stored in c?
What is a file descriptor in c?