Question
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 number:9//
p = malloc(strlen(Temp) + 1);
strcpy(p,Temp);
printf("(%s, %s)",a,p);
free(p);
free(a);
} //Line number 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






Search
Can you Answer!!
  • Q The power to establish new states in India rests with the
  • Q Merino, one of the finest types of wool, is associated with which country?
  • Q How are the objects stored on as/400?
  • Q What are proteins and functions?
  • Q Which was the first regular newspaper in Tamil language?
  • Q What advantages do numpy arrays offer over (nested) python lists?
  • Q Passat, the Volkswagen car model, is German for a type of what?
  • Q Which country overtook Afghanistan to have the largest refugee population according to U.N Refugee Agency (UNHCR)?
  • Q For what purposes can rfc's be used?
  • Q Which minerals is obtained from placer deposits ?
  • Q In class we discussed the benefits of an appraisal interview for the employee. Describe two.