Author Topic: [C/C++] Mixing C and C++  (Read 1920 times)

0 Members and 1 Guest are viewing this topic.

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18901
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
[C/C++] Mixing C and C++
« on: November 01, 2021, 01:58:05 pm »
So, how do I do it? My use case is that I know C but have C++ files to incorporate. What should I do?

I have found the stuff about marking a C header file at C in a C++ environment. If I write C is that automatically interpreted correctly as C is a subset of C++?

I am using Microchip Studio, does that help me?
 

Offline Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 5370
  • Country: nl
Re: [C/C++] Mixing C and C++
« Reply #1 on: November 01, 2021, 02:01:56 pm »
(Nearly ?) all C source code should compile just fine with C++ compiler.

 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 17808
  • Country: fr
Re: [C/C++] Mixing C and C++
« Reply #2 on: November 01, 2021, 05:38:29 pm »
There was already a thread about this: https://www.eevblog.com/forum/programming/crazyness-c-and-c-mixing/
in which the topic was discussed in details. No need to go at it all over again.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18901
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: [C/C++] Mixing C and C++
« Reply #3 on: November 01, 2021, 07:11:46 pm »
Thank you, I will take a look.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

-->