Thread: STATUS as a return type?

  1. #1
    Registered User
    Join Date
    Mar 2005
    Posts
    8

    STATUS as a return type?

    hi i just inherited some code and i am trying understand and pick apart before i start using it. there's a part of code with syntax that i am unfamilar with:

    Code:
    STATUS myfunct(void)
    {
       do stuff here.
    
       return(OK);
    }
    what i am confused about is using STATUS as a return type. I tried searching for it all over in the other code, but it doesn't seem to be defined anywhere. is that just something or a standard C++ thing or system variable? i just switched over from C and i've never seen something like this.

    i've found OK and ERROR #defined in a header file as 0 and -1, but STATUS is no where to be found. the stuff works, this stuff is just greek to me.

    i'd appreciate if anyone could explain this to me or lead me in the right direction. thanks so much!!

  2. #2
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    I can't say I've ever heard of it as standard C++. Chances are, it's defined somewhere obscure in the code you got (probably a typedef or #define as int).
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  3. #3
    Tropical Coder Darryl's Avatar
    Join Date
    Mar 2005
    Location
    Cayman Islands
    Posts
    503
    to me that just looks like Pseudocode, not meant to represent any particluar return type.

  4. #4
    Seeking motivation... endo's Avatar
    Join Date
    May 2002
    Posts
    537
    could be many things, I've used something similar to this before:

    Code:
    enum STATUS
    {
            OK,
            NOTOK
    };
    Couldn't think of anything interesting, cool or funny - sorry.

  5. #5
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398
    STATUS is NOT in the language standard. So, if it is not defined in the code, then it is defined in a special or compiler-specific library. I couldn't find it in the MSVC++ help files, so it doesn't seem to be one of the Windows typedefs.

    Do you have the compiler this program was written for? Check its help files. Does it compile?

  6. #6
    Registered User
    Join Date
    Jun 2005
    Posts
    17
    it could be an object of some class. it could be a typedef... you gotta look through the code and find first use or declaration, that should tell you more.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Getting an error with OpenGL: collect2: ld returned 1 exit status
    By Lorgon Jortle in forum C++ Programming
    Replies: 6
    Last Post: 05-08-2009, 08:18 PM
  2. can some one please tell me the cause of the error ?
    By broli86 in forum C Programming
    Replies: 8
    Last Post: 06-26-2008, 08:36 PM
  3. failure to import external C libraries in C++ project
    By nocturna_gr in forum C++ Programming
    Replies: 3
    Last Post: 12-02-2007, 03:49 PM
  4. Linking OpenGL in Dev-C++
    By linkofazeroth in forum Game Programming
    Replies: 4
    Last Post: 09-13-2005, 10:17 AM
  5. Problem with Visual C++ Object-Oriented Programming Book.
    By GameGenie in forum C++ Programming
    Replies: 9
    Last Post: 08-29-2005, 11:21 PM