Hi,

I'm having trouble with some code. I'm trying to reverse a string stored in a char array but I keep on getting the following errors:

1>z:\visual studio 2008\projects\c++lab4test2\c++lab4test2\c++lab4tes t2.cpp(50) : error C2065: 'reverse' : undeclared identifier
1>z:\visual studio 2008\projects\c++lab4test2\c++lab4test2\c++lab4tes t2.cpp(50) : error C2065: 'howMany' : undeclared identifier

Code:
#include <iostream>
#include <string>
#include <stdlib.h>
using namespace std;

using std::cout;
using std::endl;

const int max_len = 300;
class mystring

{
public:
void reverseWord(char str [], char reverse [], int howMany);
int length();
void print();
friend mystring operator+ (const mystring& a, const mystring& b);
private:
char s[max_len];
int len;
};

// Member functions of the mystring class
void mystring::reverseWord(char str [], char reverse [], int howMany)
{

for (int i = howMany -1,j=0; i>=0; i--,j++)
reverse[j] = str[i];
len = strlen(s);
}
int mystring::length()
{
return (len);
}

void mystring::print()
{
cout << s << "\nLength: " << len << "\n";
}
// Prototype of a general function (not a
// member of the mystring class)
void print(char* str);

// The program’s main function

int main()
{
char str[] = "My name is Charles Babbage.";
mystring one;
one.reverseWord(str, reverse, howMany);
print(str);
one.print();
}
I kow the problem is on this line:

one.reverseWord(str, reverse, howMany);

But if I remove reverse and howMany the I get this error:

error C2660: 'mystring::reverseWord' : function does not take 1 arguments

Apologies about the code being a mess, still struggling with the language.