This brings up a question:
If you are able to use a friend function outside of the class, you could write 
your function as a friend function, and then an alias outside of that class 
that would just call and return the friend function, right?
Only issue is when modifying class data I think, you couldn't exactly pass a 
pointer to the class, so your best bet would be to hold that in a void* or 
something.

  ----- Original Message ----- 
  From: Thomas Hruska 
  To: [email protected] 
  Sent: Friday, July 10, 2009 7:18 PM
  Subject: Re: [c-prog] Calling cpp function which contains class from a c 
function





  Sajidul Huq wrote:
  > Hi,
  > 
  > I need to call a cpp function inside a c function.The cpp file contains a 
class. But I am getting error. 
  > Can any one help me regarding how to call/use cpp function which contain 
class from a c function.
  > 
  > Regrads,
  > Rubon

  Mixing C and C++ is an intermediate topic (or advanced topic - depending 
  on what you are doing). C doesn't know what a class is. The easiest 
  approach is to create a function that is free of name-mangling outside 
  of the class that references the function in the class. Then your C 
  code can address the C++ function (i.e. the linker can find the function 
  at link-time).

  -- 
  Thomas Hruska
  CubicleSoft President
  Ph: 517-803-4197

  *NEW* MyTaskFocus 1.1
  Get on task. Stay on task.

  http://www.CubicleSoft.com/MyTaskFocus/



  

[Non-text portions of this message have been removed]

Reply via email to