Home
51.
What are member functions?

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

52.
How does structured programming work?

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.

53.
How many values can a function return?

A function can return either one value or no values. The value can be of any of the C variable types.

54.
If a function doesn't return a value, what type should it be declared?

A function that returns nothing should be type void.

55.
What's the difference between a function definition and a function prototype?

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.

56.
How deep can I nest my loops?

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.

57.
Can I nest different loop commands?

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.

58.
What is the index value of the first element in an array?

The first index value of an array in C is 0.

59.
What is the difference between a for statement and a while statement?

A for statement contains initializing and increment expressions as parts of the command.

60.
What is the difference between a while statement and a do...while statement?

A do...while contains the while statement at the end and always executes the loop at least once.