C++ in C

This is a discussion on C++ in C within the C Programming forums, part of the General Programming Boards category; hi i wonder if anyone can help me with running C++ scripts in C....i mean i have a program that ...

  1. #1
    Registered User
    Join Date
    Aug 2004
    Posts
    36

    C++ in C

    hi
    i wonder if anyone can help me with running C++ scripts in C....i mean i have a program that has some function that cannot be done in C so i have to do it in C++....is executing c++ files from C is the only option

  2. #2
    Registered User
    Join Date
    Jan 2006
    Location
    Europe/Belgrade
    Posts
    78
    In general C++ code can't be run as C code. Post the code, maybe some modification can be made.

  3. #3
    Registered User
    Join Date
    Mar 2006
    Posts
    5
    create a header file with the approate varibles and function prototypes, compile the c++ source into object code and the c source into object code, then use a linker and link both object codes into an excutatble file

    im sure someone else or google can explain it better

  4. #4
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,761
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21