C Programming Question and Answers
97. | Can you pass an entire structure to functions? |
---|---|
Yes, it is possible to pass an entire structure to a function in a call by method style. However, some programmers prefer declaring the structure globally, and then pass a variable of that structure type to a function. This method helps maintain consistency and uniformity in terms of arguments type. | |
98. | What is the difference between top down approach and bottom up approach in programming languages? |
---|---|
| |
99. | How do you convert strings to numbers in C? |
---|---|
You can write you own functions to do string to number conversions, or instead use C's built in functions. You can use a to f to convert to a floating point value, a to i to convert to an integer value and a to l to convert to a long integer value. | |
100. | What is the use of "goto" statement? |
---|---|
goto statement is used to transfer the normal flow of a program to the specified in the program. Below is the syntax for goto statement in C. { …….. goto label; …… ……. LABEL : statements; } |
|