Mombu the Programming Forum sponsored links

Go Back   Mombu the Programming Forum > Programming > parameter passing between C and C++
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 21st April 21:15
jerry coffin
External User
 
Posts: 1
Default parameter passing between C and C++



In article <vfoii2cp9ebd7e@corp.supernews.com>, v.Abazarov@attAbi.com
says...


Hmm...while it's difficult for the C++ standard to require it directly,
the struct above is pretty clearly a POD struct, and it does its best to
ensure that POD structs will be layout compatible with C.

[ ... ]

There shouldn't normally be. As I said above, it's virtually impossible
for the C++ standard to come out and directly say it has to be
compatible with C, it comes about as close as the committee figured they
could to doing exactly that.

This can certainly simplify things considerably. Perhaps more to the
point, there's not often much need to mix C and C++ for the simple
reason that at least if you have well-written source code for the C
part, chances are that converting it to compile as C++ will be fairly
trivial. Nonetheless, you don't always have well-written source code to
work with, and in that case, mixing C and C++ is perfectly reasonable
and passing structs back and forth between the two normally works quite
well.

--
Later,
Jerry.

The universe is a figment of its own imagination.
  Reply With Quote


  sponsored links


Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666