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

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

Answers were Sorted based on User's Feedback



struct node { int *a; char *b; char array[12]; }; struct node m,*n; assign the value in *a,..

Answer / 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

struct node { int *a; char *b; char array[12]; }; struct node m,*n; assign the value in *a,..

Answer / aravind

struct node
{
int *a;
char *b;
char array[12];
};
struct node m,*n;
m->a*=5;
m->*b='c';
m.array[12]={"aravind");

Is This Answer Correct ?    1 Yes 2 No

struct node { int *a; char *b; char array[12]; }; struct node m,*n; assign the value in *a,..

Answer / ricky dobriyal

/* hello i am ricky dobriyal */

struct node
{
int *a;
char *b;
char array[12];
};
struct node m,*n;
n->a=10;
n->b='5';
m.array="ricky dobriyal";

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More C Interview Questions

what is the advantage of using SEMAPHORES to ORDINARY VARIABLES???

2 Answers   NSN,


You have given 2 array. You need to find whether they will create the same BST or not. For example: Array1:10 5 20 15 30 Array2:10 20 15 30 5 Result: True Array1:10 5 20 15 30 Array2:10 15 20 30 5 Result: False One Approach is Pretty Clear by creating BST O(nlogn) then checking two tree for identical O(N) overall O(nlogn) ..we need there exist O(N) Time & O(1) Space also without extra space .Algorithm ?? DevoCoder guest Posted 3 months ago # #define true 1 #define false 0 int check(int a1[],int a2[],int n1,int n2) { int i; //n1 size of array a1[] and n2 size of a2[] if(n1!=n2) return false; //n1 and n2 must be same for(i=0;i<n1-1;i++) { if( !( (a1[i]>a1[i+1]) && (a2[i]>a2[i+1]) ) ) return false; } return true;//assumed that each array doesn't contain duplicate elements in themshelves }

0 Answers   Facebook,


2) Write a program that will help Air Traffic Control for an airport to view the sequence of flights ready for take-off. The airport can accommodate 10 flights waiting for take-off at any point in time. Each flight has a unique 3 digit numeric identifier. &#61550; Each time a flight takes-off, Air Traffic Control adds a flight to the waitlist. Each time a flight is added to the waitlist, the list of flights waiting to take-off must be displayed. &#61550; When a flight is cleared for take-off, Air Traffic Control removes the flight from the waitlist. Each time a flight takes-off, the list of flights waiting to take-off must be displayed. &#61550; Sequence of take-off is the sequence of addition to the waitlist

0 Answers  


what is a NULL Pointer? Whether it is same as an uninitialized pointer?

0 Answers   TISL,


Why we not create function inside function.

0 Answers  






#include<stdio.h> #include<conio.h> # define swap(a,b) temp=a; a=b; b=temp; void main( ) { int i, j, temp; i=5; j=10; temp=0; if( i > j) swap( i, j ); printf( "%d %d %d", i, j, temp); }

9 Answers   Burning Glass,


for questions 14,15,16,17 use the following alternatives:a.int b.char.c.string.d.float

1 Answers  


What is the Difference between Class and Struct?

10 Answers   Motorola,


Why is c used in embedded systems?

0 Answers  


How can I recover the file name given an open stream or file descriptor?

0 Answers  


What does a run-time "null pointer assignment" error mean?

2 Answers  


What is the purpose of ftell?

0 Answers  


Categories