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 / prasad
it prints BYE on screen!!!
| Is This Answer Correct ? | 15 Yes | 1 No |
Post New Answer View All Answers
What is the advantage of using #define to declare a constant?
What is the ANSI C Standard?
What are the various types of control structures in programming?
How is a macro different from a function?
What are the scope of static variables?
Explain how do you print an address?
What are the difference between a free-standing and a hosted environment?
1.int a=10; 2.int b=20; 3. //write here 4.b=30; Write code at line 3 so that when the value of b is changed variable a should automatically change with same value as b. 5.
Is main an identifier in c?
Why header files are used?
What is the size of array float a(10)?
What does the format %10.2 mean when included in a printf statement?
Is c still relevant?
What is static identifier?
Explain the difference between structs and unions in c?