Is this a qualifier or something else?

Discussion in 'C Programming' started by D.Hering, Apr 7, 2007.

  1. D.Hering

    D.Hering Guest

    When I see something like this prototype:

    SOMETHING int func( int x );

    what is SOMETHING doing there?

    thanks very much,
    -Dieter
    D.Hering, Apr 7, 2007
    #1
    1. Advertising

  2. D.Hering

    user923005 Guest

    On Apr 6, 11:11 pm, "D.Hering" <> wrote:
    > When I see something like this prototype:
    >
    > SOMETHING int func( int x );
    >
    > what is SOMETHING doing there?


    That depends on what SOMETHING says.
    Probably, it is storage class in most cases like
    extern int func( int x );
    OR
    static int func( int x );
    but if you don't show us what SOMETHING is then we can only guess
    user923005, Apr 7, 2007
    #2
    1. Advertising

  3. D.Hering

    Zero Guest

    Sometimes,

    SOMETHING is used as a define

    like

    #define COMP_LOCAL
    #define COMP_GLOBAL

    Then, the code is more readable,
    because the programmer wants to say that the function is known only in
    the modul
    or it is know in the whole project.

    Zeh Mau
    Zero, Apr 7, 2007
    #3
  4. D.Hering

    D.Hering Guest

    On Apr 7, 4:25 am, "Zero" <> wrote:
    > Sometimes,
    >
    > SOMETHING is used as a define
    >
    > like
    >
    > That depends on what SOMETHING says.
    > Probably, it is storage class in most cases like
    > extern int func( int x );
    > OR
    > static int func( int x );
    > but if you don't show us what SOMETHING is then we can only guess



    > #define COMP_LOCAL
    > #define COMP_GLOBAL
    >
    > Then, the code is more readable,
    > because the programmer wants to say that the function is known only in
    > the modul
    > or it is know in the whole project.
    >
    > Zeh Mau


    Yeah, in this particular case, it turned out to be a macro definition
    that expands out to an export/import mechanism needed for a crappy,
    market dominant, operating system which I shall leave
    nameless ;) ;) ;)

    Thanks for the inputs, I greatly appreciate it,
    -Dieter
    D.Hering, Apr 7, 2007
    #4
  5. D.Hering

    Mike Wahler Guest

    "D.Hering" <> wrote in message
    news:...
    > When I see something like this prototype:
    >
    > SOMETHING int func( int x );
    >
    > what is SOMETHING doing there?
    >
    > thanks very much,


    It's most likely some platform-specific mechanism.
    Whenever you see something like that, search any
    headers which are #included (either directly or
    indirectly), and you'll very likely find a macro
    which #defines the meaning. (Also, such a macro
    might be simply giving another name to a valid
    keyword, such as 'extern' or 'static').
    Check your headers.

    -Mike
    Mike Wahler, Apr 7, 2007
    #5
    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. Guest
    Replies:
    4
    Views:
    473
    Guest
    Oct 13, 2004
  2. Replies:
    25
    Views:
    651
    MonkeeSage
    Oct 1, 2006
  3. kj
    Replies:
    15
    Views:
    540
    Lawrence D'Oliveiro
    May 23, 2009
  4. A
    Replies:
    8
    Views:
    787
    James Kanze
    Aug 28, 2010
  5. Replies:
    4
    Views:
    206
    Tad McClellan
    Jun 1, 2007
Loading...

Share This Page