Contents Up << >>

How can I call a C function "f(int,char,float)" from C++ code?

Tell the C++ compiler that it is a C function:

extern "C" void f(int,char,float);

Be sure to include the full function prototype. A block of many C functions can be grouped via braces, as in:

  	extern "C" {
	  void* malloc(size_t);
	  char* strcpy(char* dest, const char* src);
	  int   printf(const char* fmt, ...);
	}