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 scope of variable in c?
What is the symbol indicated the c-preprocessor?
What are types of functions?
what is diffrence between linear and binary search in array respect to operators?what kind of operator can be used in both seach methods?
Explain what does a function declared as pascal do differently?
With the help of using classes, write a program to add two numbers.
Is calloc better than malloc?
Do you know the difference between malloc() and calloc() function?
What are header files and what are its uses in C programming?
What is realloc in c?
Explain heap and queue.
What is a structure and why it is used?
Write a program to check whether a number is prime or not using c?
What is const volatile variable in c?
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