473,327 Members | 2,016 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,327 software developers and data experts.

what dose it mean?

///////////////////////
#ifdef __cplusplus
extern "C" {
#endif
////////////////////////
I often find it at c/c++ head files.
Jul 22 '05 #1
1 1624
1. This has to do "name mangling" explained below, and
2. It is used for "connecting" C and C++ code, so that your project can
include both.

Suppose you write a method named "foobar". When your compiler turns your
code into an executable, it doesn't have to retain the *name* foobar; it can
change it let's say into "shmilky", as long everyone else knows that
"shmilky" really means the method you called "foobar". As a *user* of the
compiler, you usually shouldn't have to care about this.

Why would your compiler do that in the first place? probably not much of
an issue if you're not writing a compiler (check name mangling in Google, if
you're interested).
Why the extern "C", then? C and C++ are different languages, and would
understand "shmilky" differently. The extern "C" causes both of them to
understand that "shmilky" stands for "foobar" (which is what you want).

"snnn" <sn*****@gmail.com.haha.removeme> wrote in message
news:uk***********@gmail.com.haha.removeme...
///////////////////////
#ifdef __cplusplus
extern "C" {
#endif
////////////////////////
I often find it at c/c++ head files.

Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

52
by: Tony Marston | last post by:
Several months ago I started a thread with the title "What is/is not considered to be good OO programming" which started a long and interesting discussion. I have condensed the arguments into a...
2
by: s88 | last post by:
Hi all: I saw the code likes... 7 #include <stdio.h> 8 int main(void){ 9 const char *const green = "\033[0;40;32m"; 10 const char *const normal = "\033[0m"; 11 ...
13
by: ALI-R | last post by:
Hi All, When we say events are processed asynchronously in for instance Sharepoint ,what dose it mean? Thanks for your help. Ali
10
by: mandie | last post by:
Dose MS sell SQlSerever with student rate? If so, which website do I buy from?
0
by: laxmanravi2002 | last post by:
dose vb supports OOPS concepts? plz explain me
14
by: howa | last post by:
void reverse_string(char *str) { if (str == NULL) return; char tmp; size_t len = strlen(str); size_t mid = (int) len / 2; for (size_t i = 0; i < mid; i++) {
2
by: Guy Moseley | last post by:
Hi all, Could someone please point me in the right direction! I am in the process of creating an Ms Access db and as part of this use VBA in a form to create a table based on the input to the...
3
by: Car | last post by:
what dose this float value mean$B!)(B The value is: -1.#IND0
9
by: istillshine | last post by:
It seems I never need to use it. It only made a long line longer, and made you type five more characters. I feel so strange why people are talking about it.
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.