what is the purpose of getter and setter function in classes.
Last edited on
An easy way to reverse a array can be done in many ways.
I've just recently wrote a program that does it like this:
1 2 3 4 5 6 7 8 9
|
void ReverseArray(char myArray[])
{
int index;
for (index = strlen(myArray) - 1; index >= 0; --index)
{
cout << myArray[index];
}
}
|
Easy as 3.14
EDIT: Whoops had my index set to zero before. My bad.
Last edited on
You need to set index to the size of the array-1 for that to work.