- Home
- Interview Questions
- C Programming
Member functions are special functions used in object-oriented languages such as C#, C++, and Java. They are part of a class—which is a special type of structure used in object-oriented languages
Structured programming takes a complex programming problem and breaks it into a number of simpler tasks that are easier to handle one at a time.
A function can return either one value or no values. The value can be of any of the C variable types.
A function that returns nothing should be type void.
A function definition is the complete function, including the header and all the function’s statements. The definition determines what actions take place when the function executes. The prototype is a single line, identical to the function header, but it ends with a semicolon. The prototype informs the compiler of the function’s name, return type, and parameter list.
You can nest as many loops as you want. If your program requires you to nest more than two loops deep, consider using a function instead. You might find sorting through all those braces difficult, so perhaps a function would be easier to follow in code.
You can nest if, for, while, do...while, or any other command. You will find that many of the programs you try to write will require that you nest at least a few of these.
The first index value of an array in C is 0.
A for statement contains initializing and increment expressions as parts of the command.
A do...while contains the while statement at the end and always executes the loop at least once.