char S;
char S[6]= " HELLO";
printf("%s ",S[6]);
output of the above program ?
(0, ASCII 0, I,unpredictable)
Answer Posted / kiran kumar
For the Above Program u will get the Error as Conflictinf
types for S because you are declaring 2 variables of
different types one as char and another as char aray with
same names.
So, the compiler will be in Unpredicatable stage
variable name S to be consider for what type and it will
give Error as Confilctinf types for S.
Even if u replace any of the S with s then u will get the
Output of this Program as Segfault in Linux where as in
Windows u will get the HELLO.
To the Best of my Knowledge i Posted this Answer.
Let me Know if there is any better Clarifications.
My emai Id is kirjony@gmail.com
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is a floating point in c?
hi friends how r u as soon in satyam my interview is start but i m very confusued ta wat i do plz help me frndz wat can i do plz tell me some question and answers related with "C" which r asked in the interview .
What is an operator?
Explain what is the general form of a c program?
Explain the Difference between the New and Malloc keyword.
What is the difference between fread and fwrite function?
Is there anything like an ifdef for typedefs?
Is c procedural or object oriented?
Compare and contrast compilers from interpreters.
why return type of main is not necessary in linux
Write a program for Overriding.
How does pointer work in c?
What are valid operations on pointers?
What are formal parameters?
What are the valid places to have keyword “break”?