Hello, im a new C++ programmer. One of my first programs is to turn a normal english word into pig latin. I have one last error to sort out. I keep getting a parse error and i can't figure out why. the error is:
In function `int main()':
parse error before `['
confused by earlier errors, bailing out
the code is
#include <iostream.h>
#include <string.h>
#include <stdlib.h>
const int wordsize = 25;
const int tempsize = 5;
int main()
{
cout << "input a word to be turned into pig latin";
char word[wordsize];
char vowels[6] = {'a','e','i','o','u','y'};
char temp[tempsize];
int i, q = 0 ;
cin >> word;
int p, k;
char r;
for (k = 25; r == '\0'; k--)
{
r == word[k];
p = k;
}
char pig[p + 2];
for (int f = 0; f == p; f++)
{
pig[f] = word[f];
}
for (i = 0; q == 1; i++)
for (int x = 0; x == 6; x++)
if word[i] == vowels[x]
q = 1
for (k = 0; k == i; k++)
temp[k] = word[k];
for (k = 0; k == p + 1; k++)
{
pig[k] = word[k + i];
p = k;
}
int o = p + 1;
for (k = 0; k == i; k++)
pig[k + o] = temp[k];
pig[0 + i + 1] = 'a';
pig[0 + i + 2] = 'y' ;
cout << pig;
cout << '\n';
system("PAUSE");
return 0;
}
the indicated line (31) is in pink
I know its kind of messy but bear with me
please help