Hi all,
I'm really having a problem, and it is in the output results.
There are basically two loops. I want to set the first loop to be in the ouptput in the second loop.
Here is my code:
//first loop
for (int c = 0; c < wordcount; c++) {
for (int g =1; g < wordcount; g++) {
if (word[c] == word[g] ) {
cout << Dictionary[g-1] << endl;
}
}
}
//second loop
for (int i = 1 , L = 0; i <= wordcount , L <= wordcount; i++ , L++) {
cout << word[i] << " " << Dictionary[L] << " " << endl;
}
that is to be like this:
for (int i = 1 , L = 0; i <= wordcount , L <= wordcount; i++ , L++) {
cout << word[i] << " " << Dictionary[L] << " " <<
for (int c = 0; c < wordcount; c++) {
for (int g =1; g < wordcount; g++) {
if (word[c] == word[g] ) {
cout << Dictionary[g-1] << endl;
}
}
}
<< endl;
}
I tried to include them in a while loop but its not working.
hope one of you guys will help me out.
Thanks in advance.
I'm really having a problem, and it is in the output results.
There are basically two loops. I want to set the first loop to be in the ouptput in the second loop.
Here is my code:
//first loop
for (int c = 0; c < wordcount; c++) {
for (int g =1; g < wordcount; g++) {
if (word[c] == word[g] ) {
cout << Dictionary[g-1] << endl;
}
}
}
//second loop
for (int i = 1 , L = 0; i <= wordcount , L <= wordcount; i++ , L++) {
cout << word[i] << " " << Dictionary[L] << " " << endl;
}
that is to be like this:
for (int i = 1 , L = 0; i <= wordcount , L <= wordcount; i++ , L++) {
cout << word[i] << " " << Dictionary[L] << " " <<
for (int c = 0; c < wordcount; c++) {
for (int g =1; g < wordcount; g++) {
if (word[c] == word[g] ) {
cout << Dictionary[g-1] << endl;
}
}
}
<< endl;
}
I tried to include them in a while loop but its not working.
hope one of you guys will help me out.
Thanks in advance.
Comment