1) this is a character array called “hi” that is initialized to the string “HELLO\0”
2) this is an array of 3 ifstream objects
3) this is an array of 10000 long doubles, and the first is 10000
4) this is an array of 2000 character pointers
5) this is a declaration of a function named foo with no paramaters, that returns an int.
6) this is a declaration of a function named foo that takes two parameters, both of type double, that returns a double.
7) this is a call to a function names foo
8) this is a declaration of a function named foo that takes a reference to an integer and returns a reference to an integer.
You’d likely find statement five in a file where the function definition is below another function where the statement is used. In this case, the function using the foo would need to know its signature before the compiler could verify it. This is sometimes called forward declaration.
Same for 6 & 8
7 would be found in most programs where another function is required to do some work. This is generally used to break up large pieces of code into more managable or reusable chunks.
4
solved What do the following declarations mean? [closed]