Quantcast
Channel: Visual C forum
Viewing all articles
Browse latest Browse all 15302

[C++ - Class's] - about methods

$
0
0

i'm learning C++ with Teach YourSelf in 21 Days book. but i'm confuse in 1 thing about methods in a class:

they do the functions prototypes in the class. but they do the function outside of class:

class Hello
{
	private:
		int Age;
	public:

	void SetAge(int age)
	{
		Age = age; 
	}
};

but they put the SetAge() function outside of a class. it's the same or puttin outside is pro programming?


Viewing all articles
Browse latest Browse all 15302

Trending Articles



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