Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3428050
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T06:54:44+00:00 2026-05-18T06:54:44+00:00

I am quite abeginner with all that C/C++ coding. Thay say that having C

  • 0

I am quite abeginner with all that C/C++ coding. Thay say that having C library with all headers turned into C++ in a fashon like:

   #ifdef __cplusplus 
extern "C" { 
#endif 

//.. header code 

#ifdef __cplusplus 
} 
#endif 

Will make it possibe to esely use practicly any C lib from sources (modified in such way). So I thought I shall give it at least a try. but I found I have like more than 300 headers… Ofcourse I will not use all of them but any way I’d prefere to make job once. So haw can I add such code to all headers? (I work with Windows, VisualStudio 2010 and 2008)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T06:54:44+00:00Added an answer on May 18, 2026 at 6:54 am

    You only really need to do that if you have prebuilt C library code you are trying to interface your C++ code to.

    If you still have the sources and are going to build all that C code yourself, you may find it easier to just submit them to the compiler as C++ code. With some compilers it is as simple as renaming the source files to *.cpp.

    If that isn’t workable, what I’d do is start with what you have, and only bother to put the extern "C" stuff around routines you need to use directly from your C++ code as you find them. That will surely be much less than the full 300 files, right?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Quite a while ago, I heard about Object databases. Cool concept and all. Now,
I quite often see on the Internet various complaints that other peoples examples of
For quite a long time I've wanted to start a pet project that will
I know that this is quite subjective, but is it something that I have
I've been an avid learner of the Python language for quite some time. Having
Quite often I have unit tests using MSTest for code that is in a
So I have been looking all over and I haven't quite found what I
Quite simply I want to be able to test that a Asp.Net web forms
Quite simple. What's the fastest regex that will return true for any input? For
Quite often in ANSI C code I can see parenthesis sorrounding a single return

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.