It might be this what the young lad wants:
Code:
#include <iostream>
#include <cstring>
using namespace std;
#define wait 900000
char abcZ(char input[30], unsigned int& count);
int main()
{
char user[30];
unsigned int count = 0;
cout << "Translate: ";
cin.getline(user, 30);
// Do "translation"(?) until we reach the end of user input
do
{
cout << "abcZ returned: ";
cout << abcZ(user, count) << endl;
}
while( count < strlen(user));
return 0;
}
char abcZ(char input[30], unsigned int& count)
{
char letter[30] = "abcdefghijklmnopqrstuvwxyz";
// For every char in letter array
for ( unsigned int i = 0; i < strlen(letter); i++)
{
// See if current character in user input matches a character from input array
if ( input[count] == letter[i])
{
// If so return match
count++;
return letter[i];
}
}
// If not - return whatever?
count++;
return char(' ');
}
Dunno, just a guess...