char S;
char S[6]= " HELLO";
printf("%s ",S[6]);
output of the above program ?
(0, ASCII 0, I,unpredictable)
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / divakar & venkatesh
u will get the following error
conflicting types for 'S'
| Is This Answer Correct ? | 0 Yes | 1 No |
Answer / prasanth
IT`LL SHOW AS MULTIPLE DECLATION FOS S AND WE`LL NOT OBTAIN
THE OUTPUT
| Is This Answer Correct ? | 0 Yes | 2 No |
Answer / manishsoni
This gives an error, and prg is terminated.
To slove this problem we show a program..
#include<stdio.h>
#include<conio.h>
int main()
{
char S[6]= "HELLO";
printf("%s",S);
getch();
return 0;
}
this print simple hello.
| Is This Answer Correct ? | 0 Yes | 2 No |
cavium networks written test pattern ..
What is time complexity c?
print out of string in this format; 1. "rajesh" 2. \n 3. %d
What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.
write function to reverse char array ... without using second array
What is #line?
Tell me what is null pointer in c?
Who is the main contributor in designing the c language after dennis ritchie?
what is the stackpointer
Write a c program to print the sizes and ranges of different data types in c?
m=++i&&++j(||)k++ printf("%d"i,j,k,m)
Why is not a pointer null after calling free?