Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

struct node
{
int *a;
char *b;
char array[12];
};
struct node m,*n;

assign the value in *a,*b,char array[12]

Answer Posted / varun

m.a=(int*)malloc(4);
*(m.a)=2;
m.b=(char*)malloc(10);
m.b="hello";
strcpy(m.array,"world");
n=(struct node*)malloc(sizeof(struct node));
n->a=(int*)malloc(4);
*(n->a)=2;
n->b=(char*)malloc(10);
n->b="hello";
strcpy(n->array,"world");

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what is the benefit of using an enum rather than a #define constant?

1274


What is local and global variable in c?

1248


What is the correct code to have following output in c using nested for loop?

1119


What is self-referential structure in c programming?

1276


What are loops c?

1096


What is a keyword?

1217


What are the benefits of c language?

1227


Explain how can you avoid including a header more than once?

1145


What are the __date__ and __time__ preprocessor commands?

1172


What is a structure in c language. how to initialise a structure in c?

1115


What is calloc() function?

1159


How many bytes are occupied by near, far and huge pointers (dos)?

1216


Differentiate between declaring a variable and defining a variable?

1087


What are the different types of linkage exist in c?

1073


Explain heap and queue.

1139