CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2004
    Location
    A Planet Called Earth... :-)
    Posts
    835

    Undefined Behaviour or What ???

    Is the behaviour of such statements defined ???

    int i;

    i = ++i;
    i = ++i + ++i;
    i = ++i + i++;

    In C++ you are not to modify the value of a variable more than once between 2 "sequence points".
    So i was wondering if this is fine in C#.

    Does C# have any standards defined like the C++ standards???

    Thanks In Advance
    C++ program ran... C++ program crashed... C++ programmer quit !!

    Regards

    Shaq

  2. #2
    Join Date
    Apr 2005
    Location
    Norway
    Posts
    3,934

    Re: Undefined Behaviour or What ???

    Does C# have any standards defined like the C++ standards???
    Here it is:
    http://www.ecma-international.org/pu...s/Ecma-334.htm

    - petter

  3. #3
    Join Date
    Sep 2004
    Location
    A Planet Called Earth... :-)
    Posts
    835

    Re: Undefined Behaviour or What ???

    Thanks

    I created the thread clicked submit, and then clicked on stop to modify the thread. And thus 2 threads.
    I hope some moderator merges the 2 threads.
    C++ program ran... C++ program crashed... C++ programmer quit !!

    Regards

    Shaq

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured