Showing posts with label Linker errors. Show all posts
Showing posts with label Linker errors. Show all posts

Thursday, 12 January 2012

Frequently Asked Questions in Technical Round at MNCs like TCS, WIPRO, INFOSYS,..etc – 3

Predict the output or error(s) for the following:


1)

#include<stdio.h>

main()

{

struct xx


{


int x=3;


char name[]="hello";


};


struct xx *s=malloc(sizeof(struct xx));


printf("%d",s->x);


printf("%s",s->name);


}

Answer:

Compiler Error


Explanation: