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 are the functions to open and close file in c language?
What happens if you free a pointer twice?
How can I pad a string to a known length?
What is the difference between array and linked list in c?
What is static volatile in c?
What are the c keywords?
Some coders debug their programs by placing comment symbols on some codes instead of deleting it. How does this aid in debugging?
What is the use of parallelize in spark?
What is the difference between struct and union in C?
Function which gives a pointer to a binary trees const an integer value at each code, return function of all the nodes in binary tree.?
Is there a way to switch on strings?
What is the use of clrscr?
How a string is stored in c?
what is the structure pointer?
Can a variable be both const and volatile?