C Interviews
C Interview
Structure is a collection of heterogeneous (i.e. related data items which can be of different types) held together to a single unit. The data items enclosed within a structure are called its members which may be of data type int, float, char, array etc.
There are four types of storage cases: (i) Extern (ii) Static (iii) Register (iv) Auto
Major techniques used for debugging are: (i) Using compiler?s features (ii) Read The Fine Module (iii) printf( ) debugging (iv) Code grinding (v) Assertion
Library Functions are predefined functions and stored in .lib files.
Major differences between structure and union are: (i) In structure every member has its own memory whereas in union its members share the same member space. (ii) In structure, it is possible to initialize all the members at the same time which is not possible in case of union. (iii) A structure requires more space than union(for the same type of members). (iv) In union different interpretations of the same memory space are possible which is not so in case of structures.
Major advantages of using unions are: (i) Efficient use of memory as it it does not demand memory space for its all members rather it require memory space for its largest member only. (ii) Same memory space can be interpreted differently for different members of the union.
Yes! The preprocessor will include whatever the file name you mention, eg: #include, the file macros.inc will be included.
String will have static storage duration, character array will not. Unless you explicitly specify with static keyword.
In case of Static memory compiler allocates the required memory space for a declared variable, whereas in dynamic memory allocation functions malloc( ) or calloc( ) is used to get memory dynamically.
Pointers are used to manipulate data using the address. Pointers use ? operator to access the data pointed to by them. Arrays is a collection of similar datatype. Array use subscripted variables to access and manipulate data. Array variables can be Equivalently written using pointer expression.