-
Can you add pointers together? Why would you?
No, you can’t add pointers together. If you live at 1332 Lakeview Drive, and your neighbor lives at 1364 Lakeview, what’s 1332+1364? It’s a number, but it doesn’t mean anything. If you try to perform this type of calculation with pointers in a C program, your compiler will complain. The only time the addition of pointers might come up is if you try to add a pointer and the difference of two pointers....
-
What is the difference between far and near?
As described at the beginning of this chapter, some compilers for PC compatibles use two types of pointers. near pointers are 16 bits long and can address a 64KB range. far pointers are 32 bits long and can address a 1MB range. near pointers operate within a 64KB segment. There’s one segment for function addresses and one segment for data. far pointers have a 16-bit base (the segment address) and...
-
What is a modulus operator? What are the restrictions of a modulus operator?
A Modulus operator gives the remainder value. The result of x%y is obtained by(x-(x/y)*y). This operator is applied only to integral operands and cannot be applied to float or double.
-
What is a function and built-in function?
A large program is subdivided into a number of smaller programs or subprograms. Each subprogram specifies one or more actions to be performed for a large program.such subprograms are functions. The function supports only static and extern storage classes.By default, function assumes extern storage class.functions have global scope. Only register or auto storage class is allowed in the function...
-
What is the purpose of realloc( )?
the function realloc(ptr,n) uses two arguments.the first argument ptr is a pointer to a block of memory for which the size is to be altered.The second argument n specifies the new size.The size may be increased or decreased.If n is greater than the old size and if sufficient space is not available subsequent to the old region, the function realloc( ) may create a new region and all the old data are...
-
-
-
-
-
-
-
-
How to call C++ code from C ?
How can I call my C++ code from C code can you point me to some examples that are explained in detail.ThanksAjit
-
-
-
-
-
-
-
C Interview Questions
Ans