The size of the following union, where an int occupies 4 bytes of memory is
union demo
{
float x;
int y;
char z[10];
};
Answer: C
Largest size among the three structure variable is selected that is char z[10].
Enter details here
Anyone of the following can be used to declare a node for a singly linked list and “NODEPTR nodePtr;” can be used to declare pointer to a node using any of the following
/* First declaration */
typedef struct node
{
int data;
struct node *nextPtr;
}* NODEPTR;
/* Second declaration */
struct node
{
int data;
struct node * nextPtr;
};
typedef struct node * NODEPTR;
Answer: A
No answer description available for this question.
Enter details here
A user defined data type, which is used to assign names to integral constants is called ____________
Answer: D
No answer description available for this question
Enter details here
What is the similarity between a structure, union and enumeration?
Answer: B
No answer description available for this question
Enter details here
Which of the following is an incorrect syntax to pass by reference a member of a structure in a function?
(Assume: struct temp{int a;}s;)
Answer: D
No answer description available for this question
Enter details here
In the following program snippet, both s1 and s2 would be variables of structure type defined as below and there won't be any compilation issue.
typedef struct Student
{
int rollno;
int total;
} Student;
Student s1;
struct Student s2;
Answer: A
No answer description available for this question.
Enter details here
Consider the following C declaration
struct {
short s[5];
union {
float y;
long z;
}u;
} t;
Assume that objects of the type short, float and long occupy 2 bytes, 4 bytes and 8 bytes, respectively. The memory requirement for variable t, ignoring alignment considerations, is
Answer: C
No answer description available for this question.
Enter details here
Which of the following are incorrect syntax for pointer to structure?
(Assuming struct temp{int b;}*my_struct;)
Answer: A
No answer description available for this question
Enter details here
What will be the output of the following C code?
#include
enum sanfoundry
{
a,b,c=5
};
enum sanfoundry s;
main()
{
c++;
printf("%d",c);
}
Answer: A
The above code results in an error because it is not possible to modify the value of enum constants. In the above code, we have tried to increment the value of c. This results in an error.
Enter details here
Which of the following are themselves a collection of different data types?
Answer: B
No answer description available for this que
Enter details here