I can't for the life of me find a reason for this error in the suspected line or any preceding it. I haven't been able to run the algorithm even once yet so there are probably more errors along the line but this first one really has me stumped. I'm very new to this so its probably something obvious.
the code looks something like:
#include <iostream>
using namespace std;
//an algorithm to scramble a word recieved via user input
int wordlength;
string word;
int main()
{
cin>>word;
int wordlength=word.size();
for(int x = 0; int x < int wordlength; int x++) //iterates for every charachter in the word ((error line here))
{
char first_pos= word[int x]
for(int y=0; int y < word.size(); int y++)
{
char sec_pos=word[int y];
if (int x!=int y)
{
char temp = char first_pos; char first_pos = char sec_pos; char sec_pos= char temp;
word[int y]= char sec_pos; //or just: word [int y]= char first_pos;
word [int x]= char first_pos; //word [int x]= char sec_pos; without all the switching?
}
}
}
cout<<word;
system ("pause");
return 0;
}
the error comes at the first for loop, any help is appreciated.