Interview Questions

There are the collection of some imperative questions that have been asked during an interview, therefore we've decided to also share these with you. Hope you will like these, if you have any query feel free to contact us. We will be happy to know.


Interview Questions related to c, c++ and oops.

Q76. What is pre increment and post increment?

++n (pre increment) increments n before its value is used in an assignment operation or any expression containing it. n++ (post increment) does increment after the value of n is used.

Q77. What are the two forms of #include directive?

#include"filename" #include - the first form is used to search the directory that contains the source file.If the search fails in the home directory it searches the implementation defined locations.In the second form ,the preprocessor searches the file only in the implementation defined locations.

Q78. What is the difference between the functions memmove() and memcpy()?

The arguments of memmove() can overlap in memory. The arguments of memcpy() cannot.

Q79. What is a stream?

A stream is a source of data or destination of data that may be associated with a disk or other I/O device. The source stream provides data to a program and it is known as input stream. The destination stream receives the output from the program and is known as output stream.

Q80. What is meant by file opening?

The action of connecting a program to a file is called opening of a file. This requires creating an I/O stream before reading or writing the data.

Q81. What is a file pointer?

The pointer to a FILE data type is called as a stream pointer or a file pointer. A file pointer points to the block of information of the stream that had just been opened.

Q82. What are the advantages of using array of pointers to string instead of an array of strings?

Following are some advantages:

1. Efficient use of memory.
2.Easier to exchange the strings by moving their pointers while sorting.

Q83. What are the pointer declarations used in C?

1. Array of pointers, e.g , int *a[10]; Array of pointers to integer
2. Pointers to an array,e.g , int (*a)[10]; Pointer to an array of into function returning a pointer,e.g, float *f( ) ; Function returning a pointer to float.
3. Pointer to a pointer ,e.g, int **x; Pointer to apointer to int.
4. pointer to a data type ,e.g, char *p; pointer to char

Q84. What is the invalid pointer arithmetic?

1. Adding ,multiplying and dividing two pointers.
2. Shifting or masking pointer.
3. Addition of float or double to pointer.
4. Assignment of a pointer of one type to a pointer of another type.