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 with the aid of an example why arrays of structures don’t provide an efficient representation when it comes to adding and deleting records internal to the array.

3145


What are the two types of structure?

1083


What is the difference between malloc() and calloc()?

1842


What is the purpose of sprintf() function?

1117


Explain about C function prototype?

1084


How can I write data files which can be read on other machines with different word size, byte order, or floating point formats?

1026


Why c is called top down?

1155


What are the salient features of c languages?

1096


What is page thrashing?

1081


How can I rethow can I return a sequence of random numbers which dont repeat at all?

1188


What is default value of global variable in c?

987


What are the 5 organizational structures?

1025


I need a sort of an approximate strcmp routine?

1026


What is function prototype in c with example?

1075


How can I check whether a file exists? I want to warn the user if a requested input file is missing.

1142