Thread: structs and elements by reference?

  1. #16
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    Originally posted by kybert
    does the OS really check the return value from main() ?

    I returned 4 different values:

    void, -1, 0, 1

    and all have the same effect - nothing!!

    So what's the point??

    joe
    #
    Any section of code that is deemed to be "undefined" is not technically valid, and therefore should be avoided.

    >>all have the same effect - nothing!!
    Lucky you. But your code might not work elsewhere. Remember, just because it appears to work, doesn't mean it's correct.

    This is a popular discussion that comes up a lot. If you want to know more, try a board search.

    Here's the C FAQ with some helpful info: http://www.eskimo.com/~scs/C-faq/s11.html
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  2. #17
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    Originally posted by kybert

    I have no idea how it works but it does what i need(except the 'throw' because the compiler says its "reserved for future use" (VC++ 1.53)).
    -- yes, i do have VC6 and VS.net, but i prefer VC1.53 for messing with small code examples!
    If your compiler (VC++ 1.53 !!!???... wow ) cannot even handle throw, i strongly suggest using another one.
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  3. #18
    Registered User
    Join Date
    Jul 2002
    Posts
    34
    I got VS.net (VC7) but dont use it for testing simple stuff cos its just too much effort... (starting a new project... edit project... etc...)




    joe
    #

  4. #19
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    VC++ 1.53!!!! Wow!!! Does it take punch cards and do you need a 5 1/2 Floppy to install it?

    "reserved for future use"
    Definately time to put that program in a museum!

  5. #20
    Banal internet user
    Join Date
    Aug 2002
    Posts
    1,380
    I don't think there ever was a VC++ 1.53, wasn't Microsoft's compiler just called "Microsoft C" back then?

    In either case, that thing's just old!

    Code:
    new char[50];
    Error - overloaded operator "new" reserved for future use.

    LOL

  6. #21
    Registered User
    Join Date
    Jul 2002
    Posts
    34
    no it really does exist, and yes it does support new char[]...

    lol!!


    http://www.iap.uk.net/test/image1.jpg

    joe
    #

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Node type with a choice of elements
    By quizkiwi in forum C++ Programming
    Replies: 7
    Last Post: 09-01-2006, 09:41 AM
  2. const elements of struct / class not accessible?
    By talz13 in forum C# Programming
    Replies: 2
    Last Post: 03-24-2006, 05:05 PM
  3. Passing structs as parameters
    By 182 in forum C++ Programming
    Replies: 3
    Last Post: 02-15-2006, 10:51 PM
  4. Vector of Structs Question
    By gamer4life687 in forum C++ Programming
    Replies: 6
    Last Post: 09-09-2005, 10:13 PM
  5. Allocating dynamic memory for structs
    By Nevyn in forum C Programming
    Replies: 4
    Last Post: 09-17-2001, 11:54 AM