473,216 Members | 2,034 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,216 software developers and data experts.

use of extern directive

5
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
Jun 29 '07 #1
3 2070
gpraghuram
1,275 Expert 1GB
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
Jun 29 '07 #2
sarang
5
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.
Jun 29 '07 #3
gpraghuram
1,275 Expert 1GB
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
Jun 29 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: usr2003 | last post by:
I wrote the following test program to test the linkage directives extern "C": #include <stdio.h> extern "C" {
3
by: Christopher M. Lusardi | last post by:
Hello, THE PROBLEM ----------- If I compile parts of my program with CC, and C, using extern "C" as appropriate it compiles without any errors, but it does a segmentation fault when I run the...
4
by: Dan Elliott | last post by:
Hello, Converting from a working C program to C++, I run into the following error: I have a header: (header.h) namespace shared{ ... struct X{ ...
2
by: Andy | last post by:
Hi, What is implicit extern "C" declaration in C++? Can anybody give me an example? Thanks a lot! Andy
4
by: cpptutor2000 | last post by:
Could some C++ guru help me please? I am trying to build an application using gcc 3.2.3, that has a some classes using functions defined in some C files in the same directory. If inside the C++...
13
by: RainBow | last post by:
Hi everyone, (Very Sorry, if this is the wrong group in which I am posting this query). Code snippet: //C library typedef int (*PFunc)(int* aArg); void call_c_foo(PFunc aPtrtoFunc) {
10
by: Mark A. Gibbs | last post by:
I have a question about mixing C and C++. In a C++ translation unit, I want to define a function with internal linkage and C calling convention. Here's a sample of what I want to do: //...
19
by: ccwork | last post by:
Hi all, I am reading "C: A Reference Manual" 4th ed and I get lost for the "extern". It says that global object without specifying the storage-class specifier will have "extern" as the default...
4
by: mimi | last post by:
The programmer indicates to the compiler that a function is written in a different programming language using a linkage directives.It is intuitive that extern "SomeLanguage" is used to declare...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.