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 |
When should a type cast not be used?
When was c language developed?
write a program for odd numbers?
How many types of operator or there in c?
What is #include stdlib h?
What is a keyword?
What is the package for freshers(Non IIT) in amazon(hyderabad). And what is the same for those who are a contract employee.
52.write a “Hello World” program in “c” without using a semicolon? 53.Give a method to count the number of ones in a 32 bit number? 54.write a program that print itself even if the source file is deleted? 55.Given an unsigned integer, find if the number is power of 2?
25 Answers Datamatics, Solartis, TCS, ThinkBox, Trine,
void main() { int *ptr; ptr = (int *) 0x400 ; printf("ptr=%d",ptr); } output?
what is difference between array and structure?
44 Answers College School Exams Tests, CTS, Google, HCL, IBM, Motorola, TCS,
How are pointers declared in c?
What is bash c?