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
How can I sort a linked list?
What is cohesion and coupling in c?
Why is not a pointer null after calling free?
What is the equivalent code of the following statement in WHILE LOOP format?
Take an MxN matrice from user and then sum upper diagonal in a variable and lower diagonal in a separate variables. Print the result
how can i write a program that prints out a box such that whenever i press any key8(coordinate number) on the keyboard, the box moves.
What will be the outcome of the following conditional statement if the value of variable s is 10?
How can I prevent another program from modifying part of a file that I am modifying?
Explain 'bit masking'?
How do you convert strings to numbers in C?
Explain what are bus errors, memory faults, and core dumps?
What is a const pointer in c?
How can I split up a string into whitespace-separated fields?
What is #line?
Give a one-line C expression to test whether a number is a power of 2. [No loops allowed - it's a simple test.]