PDA

View Full Version : C++ Test questions..Any ideas?


maverick_pol
25th August 2007, 10:01
I have 2 question from a C++ test, that I am not sure of:quote:

1. Which stream status bit indicates EOF?

a. OxOO
b. OxO1
c. OxO2
d. OxO3
e. OxO4
f. OxO5
g. OxO6
h. None of the above

2. Which of the following conditions should satisfy the basic type casting in class ?


a. It must be a class member
b. It must not specify a return type.
c. It must have arguments
d. All
e. None

Any ideas and explanation appreciated.



Maverick

darksaga
25th August 2007, 10:46
1. Which stream status bit indicates EOF?

a. OxOO
b. OxO1
c. OxO2
d. OxO3
e. OxO4
f. OxO5
g. OxO6
h. None of the above


enum io_state {
goodbit = 0x00, // no bit set: all is ok
eofbit = 0x01, // at end of file
failbit = 0x02, // last I/O operation failed
badbit = 0x04, // invalid operation attempted
hardfail = 0x80 // unrecoverable error
};

maverick_pol
25th August 2007, 14:27
and what about this one:

2. Which of the following conditions should satisfy the basic type casting in class ?

a. It must be a class member
b. It must not specify a return type.
c. It must have arguments
d. All
e. None


Thank for the the post above.

Maverick

wysota
26th August 2007, 00:39
I assume the questions are originally in Polish. If so, could you quote the original question? The translation doesn't seem precise (for example what is "it"? The class? The cast? Casting to what?)

maverick_pol
28th August 2007, 09:25
These questions were copied/pasted from Odesk.com C++ test. Still this does not prove that there are no mistakes.
I think your assumptions about

... the questions are originally in Polish.

are not true, but there is always a possibility that you may be right.

Maverick

maverick_pol
29th August 2007, 14:48
Here is the answer for the second question(if we are talking about class cast operator):

http://www.qtforum.org/thread.php?threadid=22189

Maverick