use of extern directive

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sarang
    New Member
    • Jun 2007
    • 5

    use of extern directive

    hi,
    i m sarang the new member of 'thescripts'.
    i want to know how to use extern directive with function.
    i can better explain my problem in following way:
    I saw in one of the project, there was two files test.h and foo.c.
    a function body
    int foo(int arg)
    {
    //declarations
    }
    was defined in foo.c and test.h contained following code :
    extern int foo OF((int arg));
    I read about extern directive but have problem with understading with use of "OF(( ))" as shown in above line.

    thank you
    Last edited by sarang; Jun 29 '07, 06:25 AM. Reason: wrong file name
  • gpraghuram
    Recognized Expert Top Contributor
    • Mar 2007
    • 1275

    #2
    Originally posted by sarang
    hi,
    i m sarang the new member of 'thescripts'.
    i want to know how to use extern directive with function.
    i can better explain my problem in following way:
    I saw in one of the project, there was two files test.h and foo.c.
    a function body
    int foo(int arg)
    {
    //declarations
    }
    was defined in foo.c and test.h contained following code :
    extern int foo OF((int arg));
    I read about extern directive but have problem with understading with use of "OF(( ))" as shown in above line.

    thank you
    I think OF should have beed #defined as nothing in the project.

    Raghuram

    Comment

    • sarang
      New Member
      • Jun 2007
      • 5

      #3
      Originally posted by gpraghuram
      I think OF should have beed #defined as nothing in the project.

      Raghuram

      Thank you for ur reply.
      I got the OF in the project as :

      #define OF(args) args
      #endif

      But can you please explain its purpose.

      Comment

      • gpraghuram
        Recognized Expert Top Contributor
        • Mar 2007
        • 1275

        #4
        Originally posted by sarang
        Thank you for ur reply.
        I got the OF in the project as :

        #define OF(args) args
        #endif

        But can you please explain its purpose.
        I dont find any real usage with that.
        But other mebers in the group can help.

        Raghu

        Comment

        Working...