what will the following program do?
void main()
{
int i;
char a[]="String";
char *p="New Sring";
char *Temp;
Temp=a;
a=malloc(strlen(p) + 1);
strcpy(a,p);
//Line no:9//
p = malloc(strlen(Temp) + 1);
strcpy(p,Temp);
printf("(%s, %s)",a,p);
free(p);
free(a);
}
//Line no 15//
a) Swap contents of p & a and print:(New string, string)
b) Generate compilation error in line number 8
c) Generate compilation error in line number 5
d) Generate compilation error in line number 7
e) Generate compilation error in line number 1
Answer / abhiraj
a = malloc....
this sentence will give the error Lvalue required..
Is This Answer Correct ? | 11 Yes | 0 No |
What is the purpose of & in scanf?
How are portions of a program disabled in demo versions?
I need a help with a program: Write a C program that uses data input in determining the whole of points A and a whole of circles B. Find two points in A so that the line which passes through them, cut through the maximum number of circles.
plz answer.. a program that takes a string e.g. "345" and returns integer 345
struct node {struct node*temp,*new} prinf("%d",sizeof(struct node));
What is an array in c?
When a c file is executed there are many files that are automatically opened what are they files?
What is define c?
what different between c and c++
What is the purpose of the statement: strcat (S2, S1)?
How will you delete a node in DLL?
Which is best linux os?