A loop running within another loop is referred to as a nested loop. The first loop is called the Outer loop and inside the loop is called the Inner loop. The inner loop executes the number of times define an outer loop.
-
-
This concept called commenting out and is the way to isolate some part of the code which scans possible reason for the error. Also, this concept helps to save time because if the code is not the reason for the issue it can simply uncomment.
-
#define my_sizeof(type) (char *)(&type+1)-(char*)(&type)
-
Pointers are used for storing address of dynamically allocated arrays and for arrays which are passed as arguments to functions. In other contexts, arrays and pointer are two different things. Array name gives address of first element of array. Array members are accessed using pointer arithmetic. Compiler uses pointer arithmetic to access array element. For example, an expression like “arr[i]” is treated as *(arr + i) by the compiler. That is why the expressions like *(arr + i) work for array arr, and expressions like ptr[i] also work for pointer ptr. Array parameters are always passed as pointers, even when…
-
The file contains the definitions and prototypes of the functions being used in the program are called a header file. It is also known as a library file. Example– The header file contains commands like printf and scanf is the stdio.h.
-
Some of the data types in C have special characteristic nature when a developer assigns value beyond the range of the data type. There will be no compiler error and the value change according to a cyclic order. This is called cyclic nature and char, int, long int data types have this property. Further float, double and long double data types do not have this property. This is called cyclic nature and char, int, long int data types have this property. Further float, double and long double data types do not have this property.
-
‘==’ is the comparison operator which is used to compare the value or expression on the left-hand side with the value or expression on the right-hand side. ‘=’ is the assignment operator which is used to assign the value of the right-hand side to the variable on the left-hand side.
-
l-value or location value refers to an expression that can be used on left side of assignment operator. For example in expression “a = 3”, a is l-value and 3 is r-value. l-values are of two types: “nonmodifiable l-value” represent a l-value that can not be modified. const variables are “nonmodifiable l-value”. “modifiable l-value” represent a l-value that can be modified.
-
1) The expression ‘i++’ returns the old value and then increments i. The expression ++i increments the value and returns new value. 2) Precedence of postfix ++ is higher than that of prefix ++. 3) Associativity of postfix ++ is left to right and associativity of prefix ++ is right to left. 4) In C++, ++i can be used as l-value, but i++ cannot be. In C, they both cannot be used as l-value.
-
Uninitialized pointers in the C code are known as Wild Pointers. These are a point to some arbitrary memory location and can cause bad program behavior or program crash.