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

What is scope of variable in c?

549


What is the symbol indicated the c-preprocessor?

686


What are types of functions?

554


what is diffrence between linear and binary search in array respect to operators?what kind of operator can be used in both seach methods?

1443


Explain what does a function declared as pascal do differently?

629






With the help of using classes, write a program to add two numbers.

609


Is calloc better than malloc?

563


Do you know the difference between malloc() and calloc() function?

601


What are header files and what are its uses in C programming?

621


What is realloc in c?

571


Explain heap and queue.

575


What is a structure and why it is used?

611


Write a program to check whether a number is prime or not using c?

566


What is const volatile variable in c?

565


write a program using linked list in which each node consists of following information. Name[30] Branch Rollno Telephone no i) Write the program to add information of students in linked list

2225