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


Please Help Members By Posting Answers For Below Questions

How can I sort a linked list?

811


What is cohesion and coupling in c?

802


Why is not a pointer null after calling free?

788


What is the equivalent code of the following statement in WHILE LOOP format?

1100


Take an MxN matrice from user and then sum upper diagonal in a variable and lower diagonal in a separate variables. Print the result

1696


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.

1456


What will be the outcome of the following conditional statement if the value of variable s is 10?

1056


How can I prevent another program from modifying part of a file that I am modifying?

844


Explain 'bit masking'?

842


How do you convert strings to numbers in C?

940


Explain what are bus errors, memory faults, and core dumps?

1032


What is a const pointer in c?

876


How can I split up a string into whitespace-separated fields?

819


What is #line?

827


Give a one-line C expression to test whether a number is a power of 2. [No loops allowed - it's a simple test.]

840