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

Why we write conio h in c?

567


the portion of a computer program within which the definition of the variable remains unchanged a) mode b) module c) scope d) none

648


in linking some of os executables are linking name some of them

1651


Tell me the use of bit field in c language?

629


What is difference between class and structure?

570






Is malloc memset faster than calloc?

617


What is break in c?

587


What is preprocessor with example?

588


What does c mean before a date?

592


A collection of data with a given structure for excepting storing and providing on demand data for multiple users a) linked list b) datastructer c) database d) preprocessor

623


When do you not use the keyword 'return' when defining a function a) Always b) Never c) When the function returns void d) dfd

642


What are c preprocessors?

679


How many types of operator or there in c?

603


what is the difference between 123 and 0123 in c?

725


Devise a program that inputs a 3 digit number n and finds out whether the number is prime or not. Find out its factors.

669