Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / C++ Pop Quiz - One Question only!!

Author
Message
martelo
20
Years of Service
User Offline
Joined: 7th Jun 2004
Location:
Posted: 11th Jun 2004 01:39 Edited at: 11th Jun 2004 02:07
This was an actual pop quiz I had in class, on April 1 no less. The code compiles on Sun running g++ 3.3.2, but we weren't allowed to compile or run it. See if you can get the answer.

Enjoy!!

NOTE: For some reason, the <iostream> doesn't show up on the post, just assume it's presence after the #include statement. Everything else is fine - tested it myself just now on a sun machine.
Emperor Baal
20
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 11th Jun 2004 01:56
First of all, It would return an error. There's no iostream header, so the cout command cannot be used.

Second, if you include the iostream header, it would do nothing, because the main function is commented (or whatever its called) because of the /*.



martelo
20
Years of Service
User Offline
Joined: 7th Jun 2004
Location:
Posted: 11th Jun 2004 02:08
Oh, you're off track with the main function. Pay closer attention.
Emperor Baal
20
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 11th Jun 2004 02:17 Edited at: 11th Jun 2004 02:17
Oh, the structs get initialized, , is it this?:

.1..2.Goodbye.3.Goodbye.4..5..6.GoodbyeThis

??

Ocu
20
Years of Service
User Offline
Joined: 10th Jun 2004
Location:
Posted: 11th Jun 2004 02:20
I think it's this:

.1..2.Goodbye.3.Goodbye.4..5..6.Goodbye.7.This
Emperor Baal
20
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 11th Jun 2004 02:23
dang, got close. Too many loops for my head, thats for sure

Login to post a reply

Server time is: 2024-09-22 02:28:14
Your offset time is: 2024-09-22 02:28:14