Vindic
Vindic

Reputation: 25

Use variable of a constructor

I am not a C++ expert hence I will try to make this as clear as possible, do not hesitate to ask me about any detail you would need.

I am using a program to handle ply file. I am writing my code in MyFunction.cpp, and calling a function from AnotherFunction.cpp on my file like this : MeshFunction(myplyfile) (MeshFunction definition is in the file AnotherFunction.cpp).

Let's say that MeshFunction is using a vector of elements at a certain point and that I would like to get it in order to use it back in MyFunction.cpp; how is that possible ?

Thank you very much!

Yours faithfully, L

Upvotes: 0

Views: 54

Answers (1)

R Sahu
R Sahu

Reputation: 206717

  1. Update the interface of MeshFunction to accept std::vector<Element>& elements as another arugment.

  2. Make sure to fill elements with the necessary data in the implementation of MeshFunction.

  3. Supply the argument when calling the function.

Upvotes: 3

Related Questions