Printing out an Structure Array

closed account (16b4GNh0)
null
Last edited on
What do you expect to happen here:
1
2
3
4
5
6
7
8
9
int main() {
  std::cout << "Begin\n";

  ecollection books2;
  func3(books2);

  std::cout << "End\n";
  return 0;
}

(Your code does something equivalent.)
closed account (16b4GNh0)
i do not know what
1
2
3
4
5
6
7
 std::cout << "Begin\n";

  ecollection books2;
  func3(books2);

  std::cout << "End\n";
  return 0;


does we have not learn what std:: cout does and we are not allowed to things that were not taught.
Read: http://www.cplusplus.com/doc/tutorial/namespaces/

Your code contains: using namespace std;
If you are only allowed to use what you are taught, then you must have been taught about the namespaces and particularly about the std. How else could you have that line in your code?


However, the std::cout is irrelevant. Lets rephrase: What does happen when you add the necessary bits to my example program, compile it, and run it?

Alternatively, explain this shorter code:
1
2
ecollection books2;
func3( books2 );
Topic archived. No new replies allowed.