How to use class function in another class?

Hi,

I'm new to C++ programming and trying to make a program.

I have a class called connection which has member objects of another classes.

eg:

Class connection
{
rtp rtp_conx;
client clt;
}

RTP class has a function called:

RTPReception() where i need to use client class funtion get_client_name().

In main.cpp I have called function initRTPReception like this:

connection cnx;
cnx.rtp_conx.RTPReception(cnx);

I'm getting an error in my rtp.h:

void RTPpReception (connection)// error connection not defined.

I don't know how to use client's function in RTP class through Connection.

I have tried to explain in detail but if its not clear let me know, I will try to explain in some other way.

Any guidance would be appreciated.

Thanks,

Ash!!




Tsk tsk tsk. Class needs to be not capitalized. :)

And you need a semi-colon after the wavy brackets.

-Albatross
Topic archived. No new replies allowed.