Go through the following code sinippet
char a[20];
a="Hello Orcale Test";
will this compile?
Answer Posted / vignesh1988i
the above variable 'a' is a character array , so i would not been wrong if it has been initilized on the same line.....
but they have done that in the next line , there lies the mistake... THIS PROGRAM WILL GIVE AN ERROR why because we cant copy the entire string in a single travel by using '='(assignment) operator unless it's an initilization directly/.....
thank u
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is chain pointer in c?
What is the purpose of void in c?
What is a pointer variable in c language?
Is return a keyword in c?
Why is struct padding needed?
write a program to rearrange the array such way that all even elements should come first and next come odd
What is the main difference between calloc () and malloc ()?
What is use of integral promotions in c?
Why is not a pointer null after calling free? How unsafe is it to use (assign, compare) a pointer value after it is been freed?
Is null always equal to 0(zero)?
How many data structures are there in c?
A collection of data with a given structure for excepting storing and providing on demand data for multiple users a) linked list b) datastructer c) database d) preprocessor
The % symbol has a special use in a printf statement. Explain how would you place this character as part of the output on the screen?
Do you know the purpose of 'register' keyword?
Mention four important string handling functions in c languages .