Results 1 to 6 of 6

Thread: C++ Test questions..Any ideas?

  1. #1
    Join Date
    May 2007
    Location
    Lublin, Poland
    Posts
    345
    Thanks
    40
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default C++ Test questions..Any ideas?

    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
    Last edited by maverick_pol; 25th August 2007 at 09:24.
    Qt allows you to use everything you want
    wysota
    --------------------------------------------------------------------------------
    #if defined(Q_OS_UNIX) && defined(QT_DEBUG)
    abort(); // trap; generates core dump
    #else
    exit(1); // goodbye cruel world
    #endif

  2. #2
    Join Date
    Jan 2007
    Posts
    68
    Thanks
    9
    Thanked 8 Times in 8 Posts

    Default Re: C++ Test questions..Any ideas?

    Quote Originally Posted by maverick_pol View Post
    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
    Qt Code:
    1. enum io_state {
    2. goodbit = 0x00, // no bit set: all is ok
    3. eofbit = 0x01, // at end of file
    4. failbit = 0x02, // last I/O operation failed
    5. badbit = 0x04, // invalid operation attempted
    6. hardfail = 0x80 // unrecoverable error
    7. };
    To copy to clipboard, switch view to plain text mode 

  3. The following user says thank you to darksaga for this useful post:

    maverick_pol (25th August 2007)

  4. #3
    Join Date
    May 2007
    Location
    Lublin, Poland
    Posts
    345
    Thanks
    40
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: C++ Test questions..Any ideas?

    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
    Qt allows you to use everything you want
    wysota
    --------------------------------------------------------------------------------
    #if defined(Q_OS_UNIX) && defined(QT_DEBUG)
    abort(); // trap; generates core dump
    #else
    exit(1); // goodbye cruel world
    #endif

  5. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: C++ Test questions..Any ideas?

    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?)

  6. #5
    Join Date
    May 2007
    Location
    Lublin, Poland
    Posts
    345
    Thanks
    40
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: C++ Test questions..Any ideas?

    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
    Qt allows you to use everything you want
    wysota
    --------------------------------------------------------------------------------
    #if defined(Q_OS_UNIX) && defined(QT_DEBUG)
    abort(); // trap; generates core dump
    #else
    exit(1); // goodbye cruel world
    #endif

  7. #6
    Join Date
    May 2007
    Location
    Lublin, Poland
    Posts
    345
    Thanks
    40
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: C++ Test questions..Any ideas?

    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
    Qt allows you to use everything you want
    wysota
    --------------------------------------------------------------------------------
    #if defined(Q_OS_UNIX) && defined(QT_DEBUG)
    abort(); // trap; generates core dump
    #else
    exit(1); // goodbye cruel world
    #endif

Similar Threads

  1. Unhandled exception in qatomic
    By NewGuy in forum Qt Programming
    Replies: 14
    Last Post: 23rd July 2013, 09:49
  2. Problem pasting text into a QTextEdit
    By Spockmeat in forum Qt Programming
    Replies: 8
    Last Post: 14th March 2009, 14:36
  3. Editable text in QGraphicsView
    By wysota in forum Qt Programming
    Replies: 8
    Last Post: 24th February 2007, 15:30
  4. visible text of textedit
    By regix in forum Qt Programming
    Replies: 3
    Last Post: 26th June 2006, 09:02
  5. QTextEdit API questions (plain text)
    By Gaspar in forum Qt Programming
    Replies: 4
    Last Post: 16th May 2006, 06:03

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.