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
What does %p mean?
Is there sort function in c?
What are predefined functions in c?
Why pointers are used?
Explain about C function prototype?
What is output redirection?
Combinations of fibanocci prime series
Write a program to generate random numbers in c?
Explain the term printf() and scanf() used in c language?
How do you list a file’s date and time?
What is character set?
How can I remove the leading spaces from a string?
Explain what is wrong with this statement? Myname = ?robin?;
What is nested structure with example?
Is there any possibility to create customized header file with c programming language?