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
Do you know the difference between malloc() and calloc() function?
How do I convert a string to all upper or lower case?
What are the types of i/o functions?
What does c mean in basketball?
What is an auto keyword in c?
Can a pointer be static?
Why do we use null pointer?
Explain pointer. What are function pointers in C?
What is wild pointer in c?
What is getch?
What do you mean by dynamic memory allocation in c? What functions are used?
What is zero based addressing?
Can we declare variable anywhere in c?
What is the difference between new and malloc functions?
What is the sizeof () operator?