f(char *p)
{
p=(char *)malloc(sizeof(6));
strcpy(p,"HELLO");
}
main()
{
char *p="BYE";
f(p)
printf("%s",p);
}
what is the output?
Answer Posted / vijay
The out put is "BYE".
Because the pointer p dies when function exit with out
return,in main pointer p points to only "BYE",so prinf
prints which p points in main.
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
Can a pointer be null?
What are header files why are they important?
Explain can you assign a different address to an array tag?
Is null equal to 0 in sql?
Is there a way to have non-constant case labels (i.e. Ranges or arbitrary expressions)?
What is multidimensional arrays
What does struct node * mean?
Do you have any idea how to compare array with pointer in c?
What are the 4 types of functions?
Write a program to swap two numbers without using third variable in c?
hi folks i m approching for h1 b interview on monday 8th of august at montreal and i m having little problem in my approval notice abt my bithdate my employer has made a mistake while applying it is 12th january and istead of that he had done 18 the of january do any body have any solution for that if yes how can i prove my visa officer abt my real birthdate it urgent please let me know guys thaks dipesh patel
design and implement a data structure and performs the following operation with the help of file (included 1000 student marks in 5 sub. and %also) 1.how many students are fail in all 5 subjects (if >35) 2. delete all student data those are fail in all 5 subjects. 3. update the grace marks (5 no. if exam paper is 100 marks) 4. arrange the student data in ascending order basis of marks. 5.insert double of deleted students with marks in the list.
Explain what is the difference between functions abs() and fabs()?
how we can make 3d venturing graphics on outer interface
Why doesnt the call scanf work?