What will be result of the following program?
void myalloc(char *x, int n)
{
x= (char *)malloc(n*sizeof(char));
memset(x,\0,n*sizeof(char));
}
main()
{
char *g="String";
myalloc(g,20);
strcpy(g,"Oldstring");
printf("The string is %s",g);
}
a) The string is : String
b) Run time error/Core dump
c) The string is : Oldstring
d) Syntax error during compilation
e) None of these
Post New Answer View All Answers
What is a char c?
What is volatile c?
What are formal parameters?
what are the different storage classes in c?
What is a method in c?
What is union and structure?
What is table lookup in c?
What are operators in c?
Why is %d used in c?
Explain the priority queues?
What is a sequential access file?
Explain heap and queue.
Tell me what is null pointer in c?
What is a class c rental property?
Explain what is meant by high-order and low-order bytes?