Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Getter and Setter Functions for a class within a class

$
0
0
I'm not sure if I am being incredibly stupid but what are your opinions on how I should set values in a class by using getter and setter functions.

Should I either do :


Class A
{
private:

int a;
int b;
int c;

public:

void setClass(int a,int b,int c);
}



or should I do this :


Class A
{
private:

int a;
int b;
int c;

public:

void setA(int a);
void setB(int B)/>;
void setC(int c);

}




Any help would be appreciated.

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>