le 3/03/2000 10:42, Garth Watkins � [EMAIL PROTECTED] a �crit�:

> My question is, what is the significance of  'extern "C"
> functionPrototypes   }'

C++ supports overloading. This means that you can write 2 functions with the
same name, provided they have different arguments. Example:

void MyMethod(long  pParam);
long MyMethod(char* pParam);

The above declaration is legal in C++, not in C.

In order for the linker not to get confused with 2 identical names, C++
compilers provide what is called "named decoration", which typically makes
the above look like something (from the linker's point of view):

 &$�#%@MyMethod&$�#%@
 $*^�%%�MyMethod&�!�

Palm libraries being compiled in C, if the function declarations in the Palm
headers are not declared as C functions, the C++ compiler thinks they are
C++ decorated, and the linker fails to find them in the library modules.

By using extern "C", you explicitly tell the compiler to look for C method
names.

Eric


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html

Reply via email to