Correcting answers

J

Jay Nabonne

The answer to the question being asked is "FALSE".

We know that the code is legal, the question tells us that "cout<<test" is
legal.

We are to decide whether the reason that the code is legal is due to the
fact that test() takes no parameters. Since the code would still be legal if
test did take one or more parameters, the number of parameters that test()
accepts could not be the explanation for why the the code compiles. So the
answer is "FALSE".

The actual reason the code is legal is for the reasons already provided
above.

Greg

Makes perfect sense. Thanks.
 
M

Markus Becker

Jay Nabonne said:
Simplistically, to me "legal" means "a compilable, runnable program". The
program as is will compile and run. It just won't do what I believed the
person creating the question meant it would do (it prints out the address

That's the problem with programs: They don't do what the programmer
_wanted_ it to do, but it will do what the programmer _told_ it to ;-)
of the function instead of invoking it). But there's nothing illegal about
it. It's a question of desired effect. Someone could quite easily want to
do the above in a debugging situation.

The question had some hint on _why_ the answer should be FALSE or TRUE
and this has nothing to do with the number of arguments.
You are correct. I guess I should have more clearly said "The trailing
semi-colon on the "funcTest" line results in a *subsequent* syntax error."

Since the question stated this was supposed to be a definition (not a
declaration), I assumed the semi-colon was the erroneous part, not the
block following.

Semantically, it is, but syntactically it is not. We should try to be
exact-to-the-word in this group, shouldn't we?
Thanks. That was a rhetorical question to the previous caller. ;)

*g*

I didn't mean to criticize you, it was meant to make the topic a little
bit clearer to the previous poster just in case he didn't get your
rhetoric. :)

Markus
 
M

Markus Becker

Jay Nabonne said:
Makes perfect sense. Thanks.

It could be that you did not get my unquoted point because
of the fact that english isn't my native language and at times
my command of it is a little bit shakey.
Especially when it comes to nit-picking. ;-)

Markus
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top