What are structures and unions? State differencves between them.
Answer / Pankaj Nsom
"Structures in C are user-defined data types that group multiple variables together, each of which may have a different type. A structure can be declared as: struct student { char name[30]; int roll_number; float marks; }; Unions in C allow a variable to occupy the memory space of another variable of a different type. Only one member of a union can store a value at any given time. They are useful when multiple data types need to be stored in the same memory location, but they share the same memory footprint."
| Is This Answer Correct ? | 0 Yes | 0 No |
whats the use of header file in c?
Write a program using bitwise operators to invert even bits of a given number.
What is declaration and definition in c?
How do we make a global variable accessible across files? Explain the extern keyword?
what is a function prototype?
what is the use of ‘auto’ keyword?
I came across some code that puts a (void) cast before each call to printf. Why?
What is the difference between if else and switchstatement
Describe dynamic data structure in c programming language?
void main(int argc,char *argv[],char *env[]) { int i; for(i=1;i<argc;i++) printf("%s",env[i]); }
One of the Institutes contains 5 student groups. Every group contains 4 students. Institute wants to store student group’s details in array. Group should contain group member’s details (name and registration number and age), project name, and mark of the group.
what does keyword ‘extern’ mean in a function declaration?