[try Beta version]
Not logged in

 
making member required

Feb 10, 2020 at 8:01pm
I have a struct :
struct Vector {
vector<pair<int,int>> pnts;
int ind;
}
When i use this struct how do i make it such that the ind also have to be specified cumpulsory?
Feb 10, 2020 at 10:48pm
It's hard to figure out what you are trying to do. Could you give us some examples of what you want to happen, and perhaps what you don't want? If you're wanting to enforce that every access to an object of type Vector must have a ind with it, then you probably want to mark pnts as private, and then access it through some member functions. Hmm... maybe use a class instead?

Oh, and maybe think about some helpful member names. What's pnts anyway? punts? pants? pinatas? same goes for ind ....
Topic archived. No new replies allowed.