C program interview question?
Describe pointer in C?
The pointer is used to describe the address of variables.That means direct address of the memory allocation. The declaration of pointer is int*a;
here the declare the value a as integer.
Example: int *a,c;
What is syntax errors?
The error that occur while running a program are called syntax errors.That will occur when misspelled commands or incorrect case commands, incorrect number of parameters in function, data types mismatches can be identified as common error.
What is sequential access files?
The general program stores data into files and retrieve existing data from files. With the sequential access file such data are saved in a sequential pattern.When retrieving data from such files each data is read one by one until the required information is found.
What is the difference between abs() and fabs() functions?
Both the functions are retrieve absolute value. The difference is abs() is for integer value and fabs() for floating type numbers.Prototype for abs() is under the library file stdio.h and math.h.
What is masking?
The masking refers to the process of extracting desired bits from a variable by using logical bit wise operation. The operand that is used to perform masking is called mask.
Example:y=x & mask;
y= x I mask;
The masking is used in different ways.
- To decide bite pattern of an integer variable.
- To copy a portion of a given bit pattern to a new variable,while the remainder of the new variable is filled with 0s.
- To copy a portion of a given bit pattern to a new variable,while the remainder of the new variable is filled with 1s.
- To copy a portion of a given bit pattern to a new variable,while the remainder of the orginal bit pattern is inverted within the new variable.