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 |
Write a C program to check a number even or odd, without using any relational, arithmetic operator and any loops.
Write a C program that computes the value ex by using the formula ex =1+x/1!+x2/2!+x3+3!+………….
what are advantages of U D F?
Why doesn't the code "a[i] = i++;" work?
How to write a code for reverse of string without using string functions?
what is the answer for it main() { int i; clrscr(); printf("%d",&i)+1; scanf("%d",i)-1; }
How can I find out how much free space is available on disk?
What is extern keyword in c?
main() { int i=0; while(+(+i--)!=0) i-=i++; printf("%d",i); }
Where register variables are stored in c?
a c variable cannot start with a) an alphabet b) a number c) a special symbol d) both b and c above
What is the heap in c?