Test your C/C++ Skills [Free Online Test]

Discussion in 'C Programming' started by pmp, Oct 27, 2009.

  1. pmp

    pmp Guest

    pmp, Oct 27, 2009
    #1
    1. Advertising

  2. pmp

    Phil Carmody Guest

    Richard Heathfield <> writes:
    > In <>,
    > pmp wrote:
    >
    >> free online test of c/c++ try now http://www.itworld2.com

    >
    > If you take away all the registration stuff, I'll be glad to take a
    > look at it.


    I'd say that c/c++ is undefined...

    Phil
    --
    Any true emperor never needs to wear clothes. -- Devany on r.a.s.f1
    Phil Carmody, Oct 27, 2009
    #2
    1. Advertising

  3. Kenneth Brody <> writes:
    > Phil Carmody wrote:
    >> Richard Heathfield <> writes:
    >>> In
    >>> <>,
    >>> pmp wrote:
    >>>
    >>>> free online test of c/c++ try now http://www.itworld2.com
    >>> If you take away all the registration stuff, I'll be glad to take a
    >>> look at it.

    >>
    >> I'd say that c/c++ is undefined...

    >
    > It depends on the definition of "c".
    >
    > For example, given the definition "const int c;", the expression
    > "c/c++" is well defined. (FSVO "defined".)
    >
    > :)


    It's a constraint violation. The only requirement on the
    implementation is that it must produce a diagnostic. Once it's
    produced that diagnostic, it's free to continue to translate the
    program, which may then execute but whose behavior is not defined
    by the standard.

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    Nokia
    "We must do something. This is something. Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"
    Keith Thompson, Oct 27, 2009
    #3
  4. pmp

    Flash Gordon Guest

    Keith Thompson wrote:
    > Kenneth Brody <> writes:
    >> Phil Carmody wrote:
    >>> Richard Heathfield <> writes:
    >>>> In
    >>>> <>,
    >>>> pmp wrote:
    >>>>
    >>>>> free online test of c/c++ try now http://www.itworld2.com
    >>>> If you take away all the registration stuff, I'll be glad to take a
    >>>> look at it.
    >>> I'd say that c/c++ is undefined...

    >> It depends on the definition of "c".
    >>
    >> For example, given the definition "const int c;", the expression
    >> "c/c++" is well defined. (FSVO "defined".)
    >>
    >> :)

    >
    > It's a constraint violation. The only requirement on the
    > implementation is that it must produce a diagnostic.


    Which, of course, is the 'VI "defined"' to hich Kenneth was referring.

    > Once it's
    > produced that diagnostic, it's free to continue to translate the
    > program, which may then execute but whose behavior is not defined
    > by the standard.


    True, but it's defined as producing a diagnostic during translation.
    --
    Flash Gordon
    Flash Gordon, Oct 28, 2009
    #4
  5. Flash Gordon <> writes:
    > Keith Thompson wrote:
    >> Kenneth Brody <> writes:
    >>> Phil Carmody wrote:
    >>>> Richard Heathfield <> writes:
    >>>>> In
    >>>>> <>,
    >>>>> pmp wrote:
    >>>>>
    >>>>>> free online test of c/c++ try now http://www.itworld2.com
    >>>>> If you take away all the registration stuff, I'll be glad to take a
    >>>>> look at it.
    >>>> I'd say that c/c++ is undefined...
    >>> It depends on the definition of "c".
    >>>
    >>> For example, given the definition "const int c;", the expression
    >>> "c/c++" is well defined. (FSVO "defined".)
    >>>
    >>> :)

    >>
    >> It's a constraint violation. The only requirement on the
    >> implementation is that it must produce a diagnostic.

    >
    > Which, of course, is the 'VI "defined"' to hich Kenneth was referring.
    >
    >> Once it's
    >> produced that diagnostic, it's free to continue to translate the
    >> program, which may then execute but whose behavior is not defined
    >> by the standard.

    >
    > True, but it's defined as producing a diagnostic during translation.


    Pedant!

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    Nokia
    "We must do something. This is something. Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"
    Keith Thompson, Oct 28, 2009
    #5
  6. Kenneth Brody <> writes:
    > Keith Thompson wrote:
    >> Flash Gordon <> writes:
    >>> Keith Thompson wrote:
    >>>> Kenneth Brody <> writes:
    >>>>> Phil Carmody wrote:
    >>>>>> Richard Heathfield <> writes:
    >>>>>>> In
    >>>>>>> <>,
    >>>>>>> pmp wrote:
    >>>>>>>
    >>>>>>>> free online test of c/c++ try now http://www.itworld2.com
    >>>>>>> If you take away all the registration stuff, I'll be glad to take a
    >>>>>>> look at it.
    >>>>>> I'd say that c/c++ is undefined...
    >>>>> It depends on the definition of "c".
    >>>>>
    >>>>> For example, given the definition "const int c;", the expression
    >>>>> "c/c++" is well defined. (FSVO "defined".)
    >>>>>
    >>>>> :)
    >>>> It's a constraint violation. The only requirement on the
    >>>> implementation is that it must produce a diagnostic.
    >>> Which, of course, is the 'VI "defined"' to hich Kenneth was referring.

    >
    > Thanks. :)
    >
    >>>> Once it's
    >>>> produced that diagnostic, it's free to continue to translate the
    >>>> program, which may then execute but whose behavior is not defined
    >>>> by the standard.
    >>> True, but it's defined as producing a diagnostic during translation.

    >>
    >> Pedant!

    >
    > This group thrives on pedantry.
    >
    > Okay, what about:
    >
    > extern void c(void);
    >
    > Are we in the realm of "must fail to compile" yet?


    Nope. The only case where something "must fail to compile" is
    when a #error directive survives any #if and #ifdef directives.
    In all other cases (constraint violations, syntax rule violations,
    undefined behavior, hard drive containing source has lost power), the
    compiler is free to proceed after issuing any required diagnostics.

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    Nokia
    "We must do something. This is something. Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"
    Keith Thompson, Oct 28, 2009
    #6
  7. Kenneth Brody <> writes:
    > Keith Thompson wrote:
    >> Kenneth Brody <> writes:

    > [... "c/c++" ...]
    >>> Okay, what about:
    >>>
    >>> extern void c(void);
    >>>
    >>> Are we in the realm of "must fail to compile" yet?

    >>
    >> Nope. The only case where something "must fail to compile" is
    >> when a #error directive survives any #if and #ifdef directives.
    >> In all other cases (constraint violations, syntax rule violations,
    >> undefined behavior, hard drive containing source has lost power), the
    >> compiler is free to proceed after issuing any required diagnostics.

    >
    > That's what I remembered after clicking "send". :-|
    >
    > (And, of course, macros can't expand to preprocessor directives.)
    >
    > So, technically, syntax rule violations are also UB? (Can a compiler
    > print a diagnostic and then reformat the hard drive, and still be
    > "conforming"?)


    Yes. When you sue the vendor for reformatting your hard drive, you
    won't be able to claim that the compiler is non-conforming.

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    Nokia
    "We must do something. This is something. Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"
    Keith Thompson, Oct 28, 2009
    #7
  8. pmp

    Phil Carmody Guest

    Kenneth Brody <> writes:
    > Keith Thompson wrote:
    >> Kenneth Brody <> writes:

    > [... "c/c++" ...]
    >>> Okay, what about:
    >>>
    >>> extern void c(void);
    >>>
    >>> Are we in the realm of "must fail to compile" yet?

    >>
    >> Nope. The only case where something "must fail to compile" is
    >> when a #error directive survives any #if and #ifdef directives.
    >> In all other cases (constraint violations, syntax rule violations,
    >> undefined behavior, hard drive containing source has lost power), the
    >> compiler is free to proceed after issuing any required diagnostics.

    >
    > That's what I remembered after clicking "send". :-|
    >
    > (And, of course, macros can't expand to preprocessor directives.)
    >
    > So, technically, syntax rule violations are also UB? (Can a compiler
    > print a diagnostic and then reformat the hard drive, and still be
    > "conforming"?)


    We prefer to call that model the 'conformatting' version.

    Phil
    --
    Any true emperor never needs to wear clothes. -- Devany on r.a.s.f1
    Phil Carmody, Oct 28, 2009
    #8
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sharath

    Test Your C Skills - Errors

    Sharath, Apr 19, 2007, in forum: C Programming
    Replies:
    24
    Views:
    791
    Christopher Benson-Manica
    Apr 23, 2007
  2. Replies:
    9
    Views:
    1,371
    Puppet_Sock
    Jan 4, 2008
  3. Replies:
    15
    Views:
    1,518
    Richard Heathfield
    Mar 14, 2008
  4. george
    Replies:
    0
    Views:
    1,083
    george
    Aug 29, 2008
  5. pmp
    Replies:
    1
    Views:
    6,970
    .rhavin grobert
    Oct 24, 2008
Loading...

Share This Page