0
void Sort()
		{
			int Holder, k = 0;
			srand( time(0) ); // seed random number generator
			while ( k < HowMany )
			{
				Holder = rand(); // generate random number to Holder
				if ( Holder > 10 && Holder < 100 )
				{
					Numbers[k] = Holder;
					k++;
				}
			}
			int Temp;
			bool Swap;
			Swap = false;
			while ( !Swap )
			{
				Swap = true;
				for ( k = 0; k < HowMany-1; k++ )
				{
					if ( Numbers[k] > Numbers[k+1] )
					{
						Temp = Numbers[k];
						Numbers[k] = Numbers[k+1];
						Numbers[k+1] = Temp;
						Swap = false;
					}
				}
			}
		}

this is in my header file, and in my header file there is a

void ShowValues()

how can i make this function call so in my

main()

I only need to write

CTest MyTest(10,10); MyTest.ShowValues();

then i will output the values of random and sorted random numbers?

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by tenorsax08
0

I'm assuming that function is in the MyTest class, correct? If so, it should not be in your header file. The header file only contains declarations, but not the actual implementation. The implementation you have in the header file should work, but you should move the function into the class.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.