C Programming Interview Questions and Answers - 6

Question: 26

What is pointer linking with operating system?

When we declare a null pointer it addresses the 0 address which is the address of operating system so we cannot use that address this is what the pointer is linked to OS.

Question: 27

Is there a built in function in C that can be used for sorting data?

Yes, use the qsort() function. It is also possible to create user defined functions for sorting, such as those based on the balloon sort and bubble sort algorithm.

Question: 28

How do you determine the length of a string value that was stored in a variable?

To get the length of a string value, use the function strlen(). For example, if you have a variable named FullName, you can get the length of the stored string value by using this statement: I = strlen(FullName); the variable I will now have the character length of the string value.

Question: 29

What does the function toupper() do?

It is used to convert any letter to its upper case mode. Toupper() function prototype is declared in <ctype.h>. Note that this function will only convert a single character, and not an entire string.

Question: 30

What is NULL in C?

NULL is a macro which defined in C header files. The value of NULL macro is 0. It is defined in C header files as below

#define NULL (void *) 0;

NULL is used for pointers only as it is defined as (void *) 0. It should not be used other than pointers. If NULL is assigned to a pointer, then pointer is pointing to nothing.

Related Questions