C Programming Question and Answers
53. | Describe how arrays can be passed to a user defined function? |
---|---|
One thing to note is that you cannot pass the entire array to a function. Instead, you pass to it a pointer that will point to the array first element in memory. To do this you indicate the name of the array without the brackets. | |
54. | When should we use pointers in a C program? |
---|---|
|
|
55. | How do check whether macro is defined or not in C program? |
---|---|
"#ifdef" pre-processor directive checks whether particular macro is defined or not in a C program. | |
56. | What happens when the user gives a command to run a program? |
---|---|
The operating system first allocates the requisite amount of memory to the program, then, through loader, loads the program in the allocated memory, and then passes on the control to the program. The program runs the supervision of the operating system. When the program finishes its execution or some runtime errors occurs, the operating system removes the program from the memory. | |