All pastes #17488 Raw Edit

Someone

public text v1 · immutable
#17488 ·published 2005-07-11 22:36 UTC
rendered paste body
#ifndef function_h
#define function_h

#include <iostream>
#include <string>

namespace textstuff
{
	class textthings
	{
		public:
			static void dotext(int tcount)
			{
				for (int i = 0; i <= tcount-1; i++)
				{
					std::cout << "monkey " << i << std::endl;
				}

				//pointer
				dopointerid(&monkeycount);
				std::cout << "pointer int:" << monkeycount << std::endl;

				//pointer reference
				dorefid(monkeycount);
				std::cout << "pointer ref:" << monkeycount << std::endl;
			}

			static void dopointerid(int* intarg)
			{
				*intarg = 10;
			}

			static void dorefid(int& intarg)
			{
				intarg = 15;
			}

		protected:
			static int monkeycount; // <<< need to set this to 20 by default
	};
}
#endif