Sending data from a C program to a c++ application

This is a discussion on Sending data from a C program to a c++ application within the C Programming forums, part of the General Programming Boards category; Hi, I need to send a simple integer flag value (0/1) from a C program to a C++ application. Can ...

  1. #1
    Registered User
    Join Date
    Aug 2012
    Posts
    1

    Sending data from a C program to a c++ application

    Hi,

    I need to send a simple integer flag value (0/1) from a C program to a C++ application. Can anybody suggest what is the simplest way of doing this?

    Regards

  2. #2
    SAMARAS std10093's Avatar
    Join Date
    Jan 2011
    Location
    Nice, France
    Posts
    2,675
    Quote Originally Posted by Mhox View Post
    Hi,

    I need to send a simple integer flag value (0/1) from a C program to a C++ application. Can anybody suggest what is the simplest way of doing this?

    Regards
    Once i had to use a C library from a collegue in a C++ project.What we did was this
    Code:
    extern "C" {
    #include "BF.h"//the library in C
    }
    Then in the .cpp file i used the functions of this library as you could use a c++ function.For example if BF.h had a prototype like this
    Code:
    int function(int var);
    then in the .cpp file i would write something like this
    Code:
    extern "C" {
    #include "BF.h"//the library in C
    }
    ...
    int flag = function(value);
    ..

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Sending keystrokes to other *non-focus* application
    By audi02 in forum Windows Programming
    Replies: 6
    Last Post: 08-06-2009, 02:41 PM
  2. Replies: 1
    Last Post: 03-19-2009, 02:15 AM
  3. Replies: 5
    Last Post: 08-16-2007, 11:43 PM
  4. Sending emails through a windows application/openGL
    By two31d in forum C++ Programming
    Replies: 5
    Last Post: 01-28-2006, 01:48 AM
  5. Replies: 1
    Last Post: 06-06-2002, 04:17 PM

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