Thread: C++ in C

  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 int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    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.

Popular pages Recent additions subscribe to a feed