f(*p)
{
p=(char *)malloc(6);
p="hello";
return;
}
main()
{
char *p="bye";
f(p);
printf("%s",p);
}
what is the o/p?
Answers were Sorted based on User's Feedback
Answer / fazlur rahaman naik
actually the above programme produces an error.because u've
to mention which type of pointer it is at fuction f(*p).
i.e f(char *p).
if u correct this error.then the out put will be
bye
Is This Answer Correct ? | 4 Yes | 1 No |
Answer / yellareddy
After removing the error, the output is "bye"
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / subbu
after correction of error, the output will be hello
Is This Answer Correct ? | 1 Yes | 2 No |
How can I make it pause before closing the program output window?
Will Macros support multiple arguments ?
Differentiate fundamental data types and derived data types in C.
we called a function and passed something do it we have always passed the "values" of variables to the called function. such functions calles are called a) calls by reference b) calls by value c) calls by zero d) none of the above
There is a number and when the last digit is moved to its first position the resultant number will be 50% higher than the original number.Find the number?
write a program which the o/p should b in such a way that s triangle if I/p is 3,a Square/rectangle if I/P=4,a pentagon if I/P=5 and so on...forget about the I/P which is less than 3
What is the difference between union and anonymous union?
How to swap two values using a single variable ? condition: Not to use Array and Pointer ?
Write a program to enter the name and age. If age>28 then find salary categories. if age<28 then find that you are gaduate or not.
The operation of a stair case switch best explains the a) or operation b) and operation c)exclusive nor operation d)exclusive or operation Which of the following is/are syntactically correct? a) for(); b) for(;); c) for(,); d) for(;;);
1 Answers HCL, Public Service Commission,
What is the Purpose of 'extern' keyword in a function declaration?
What is a macro?