Thread: Use of C++ header file in C program file calling C++ function declared in that header

  1. #31
    Registered User
    Join Date
    Jul 2005
    Quote Originally Posted by anonytmouse
    What has been refuted is your statement and the assumptions you made based on it:
    Quote Originally Posted by hzmonte
    2. 'extern "C" ' tells the C++ compiler to compile that bit of code as C code
    That statement was first stated by King Mir. It was refuted by me before anyone else. (Actually quzah agreed to it in his/her June 16 3:17PM post.)
    Quote Originally Posted by citizen
    We tried to explain that a C compiler will not compile C++ code, so if your problem was really just what Stroustrup wrote why did you post here? Reading the thread it is as though as you weren't satisfied with the answer to your question until somebody told you that you were totally right.
    So the big question: are you going to argue with Stroustrup too?
    Maybe someone tried to explain that a C compiler will not compile C++ code, though I already said that I understood it. But I think some people also tried to tell me that a C program (to be compiled by a C compiler) cannot call a C++ function compiled by a C++ compiler. And I think this is not just "my problem"; obviously this is the problem of some other C++ programmers. I would like to set the record straight here so that others can benefit. It is not that I would not be satisfied until somebody told me that I am totally right; it does not matter whether I am right or wrong. It matters what is right or wrong and why.
    To me, the big question is never whether I would argue with someone; it is what the truth is. If the pursuit of knowledge requires me to argue with Stroustrup, I will.
    Quote Originally Posted by anonytmouse
    I think you know that what you have stated in your email is correct.
    Well, I think my interpretation is correct; but someone disagreed. Therefore, for the benefit or myself, those who disagree, and whoever in the future who want to learn in this topic, why not ask Stroustrup and document it here?
    Quote Originally Posted by anonytmouse
    All of this is explaned quite well in the FAQ link that Dave posted.
    If you read all my posts, you should have read my response to it.

    Here is Stroustrup's reply:

    From : Bjarne Stroustrup <bs at cs . tamu . edu>
    Sent : Sunday, June 18, 2006 2:56 AM
    Subject : Re: Correct intepretation of your comments on C++

    Maybe this clarifies things?:

    Note that ``extern "C"'' can appear only in a C++ program. C doesn't have a corresponding ``extern "C++"''
    Last edited by hzmonte; 06-19-2006 at 11:05 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help understanding Header Files
    By Kaidao in forum C++ Programming
    Replies: 11
    Last Post: 03-25-2008, 10:02 AM
  2. We Got _DEBUG Errors
    By Tonto in forum Windows Programming
    Replies: 5
    Last Post: 12-22-2006, 05:45 PM
  3. Calling a Thread with a Function Pointer.
    By ScrollMaster in forum Windows Programming
    Replies: 6
    Last Post: 06-10-2006, 08:56 AM
  4. <Gulp>
    By kryptkat in forum Windows Programming
    Replies: 7
    Last Post: 01-14-2006, 01:03 PM
  5. Possible circular definition with singleton objects
    By techrolla in forum C++ Programming
    Replies: 3
    Last Post: 12-26-2004, 10:46 AM