Geek question

Feb 11, 2007 02:43

I just finished my mid-terms and I thought I would throw this out there.  How would you answer this true/false question?

The word int before main () tells the C++ compiler that main produces numbers.

I'm just curious how other programmers might answer this.

geek

Leave a comment

Comments 5

jessekornblum February 11 2007, 11:47:02 UTC
I'd say false. The int says that the function returns one number. In the meantime it could produce lots and lots of numbers. (Perhaps even a dance number!)

Reply

lledynot February 13 2007, 01:55:48 UTC
I didn't think of it that way. My instructor had a different answer, one I'm not sure I fully agree with.

Prof's response:
"The word int before main () tells the C++ compiler that main produces integers. Using the term "numbers" is incorrect because there are different types of numbers that are treated differently."

My thinking was that an integer is a number, it isn't a double, or floating number, but it will always be a number. int main() will never return anything but a number.

But I could be completely wrong.

Reply


amazonsun February 11 2007, 19:04:46 UTC
LOL....that made absolutely no sense to me! :P

Reply

lledynot February 13 2007, 01:56:32 UTC
I thought you went to collage and were edumacated????? What happened???

:)

Reply

amazonsun February 13 2007, 04:12:45 UTC
What happened?? I didn't go to college. That's what happened! (And no...that one semester that I flunked out of doesn't count.)

Reply


Leave a comment

Up