samedi 25 avril 2015

Passing MyClass defined in header as function argument to other file


I've spent around an hour and couldn't find anything helpful on the Web. The problem is that I've got some files like a.h, b.h, a.cpp, b.cpp and main.cpp. In a.h I've got declared a container with attributes defined by myself. I would like to pass this container as and argument to the function in b.h/b.cpp. What is the way of doing this?

a.h file

struct Container{
int size;
int* array
...};

b.cpp

void someFunction(Container container)
{...}

Thanks for any help.


Aucun commentaire:

Enregistrer un commentaire