Jump to content

  • Log In with Google      Sign In   
  • Create Account

putting c in a .cpp


Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
3 replies to this topic

#1   Members   

122
Like
Likes
Like

Posted 23 January 2002 - 10:40 AM

is it possible to put C code into a .cpp? if so could somebody fill me in on how or what to search for on MSDN?

#2   Members   

386
Like
Likes
Like

Posted 23 January 2002 - 10:45 AM

Yes, but you can''t do it the other way around. C++ is an extension of C.

#3   Members   

122
Like
Likes
Like

Posted 23 January 2002 - 10:45 AM

Yup.
  
extern "C" {

// C declarations and C code


}

You''re going to want to do this for the function declarations (in the .h) and the functions themselves (in the .cpp)



#4   Members   

122
Like
Likes
Like

Posted 23 January 2002 - 10:50 AM

thanks




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.