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 |
what wud be the output? main() { char *str[]={ "MANISH" "KUMAR" "CHOUDHARY" }; printf("\nstring1=%s",str[0]); printf("\nstring2=%s",str[1]); printf("\nstring3=%s",str[2]); a)string1=Manish string2=Kumar string3=Choudhary b)string1=Manish string2=Manish string3=Manish c)string1=Manish Kumar Choudhary string2=(null) string3=(null) d)Compiler error
Program to find larger of the two numbers without using if-else,while,for,switch
Write a program to print numbers from 1 to 100 without using loop in c?
how to connect oracle in C/C++.
What are the disadvantages of a shell structure?
Why c is faster than c++?
how to find that no is int or float?
How can you call a function, given its name as a string?
What is a segmentation fault?
Is flag a keyword in c?
can any one provide me the notes of data structure for ignou cs-62 paper
Why is python slower than c?