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 / deepa
SOORY FOR POSTIN THE WRONG ANSWER THE ANSER WUD BE BYE COZ
THE *P DIES IN THE FUNCTION ITSELF AS WE ARE NOT RETURNING
THE STRING BACK IN THE MAIN PROGRAM
| Is This Answer Correct ? | 4 Yes | 1 No |
Post New Answer View All Answers
What the advantages of using Unions?
I need testPalindrome and removeSpace
#include
What are the __date__ and __time__ preprocessor commands?
Write a program to swap two numbers without using a temporary variable?
Do you know null pointer?
Are there any problems with performing mathematical operations on different variable types?
Why string is used in c?
What are header files in c programming?
Explain high-order and low-order bytes.
what is reason of your company position's in india no. 1.
Add Two Numbers Without Using the Addition Operator
How pointers are declared?
How can a program be made to print the name of a source file where an error occurs?
Write a program, where i have a grid with many cells, how many paths are possible from one point to other desired points.
Explain how can I prevent another program from modifying part of a file that I am modifying?