Hey guys,
I really appreciate the effort and time you take out to help me become a better coder :!: I know I'm not the best and it takes alot of time, but, I'm having so much fun in learning this(even if they are simple programs).
I also, worked out the pseudo code WaltP gave me and turned it into this:
#include <iostream>
int main()
{
char words[5][10];
for (size_t i = 0; i < 5; ++i)
std::cin >> words[i];
std::cout << std::endl;
for (size_t i = 0; i < 5; i++)
{
bool contr = true;
for (size_t j = i+1; j < 5; j++)
{
if(strcmp(words[i], words[j]) == 0)
{
contr = false;
break;
}
}
if(contr == true)
std::cout << words[i] << '\n';
}
std::cin.ignore(2);
return 0;
}
I think it differs abit from the pseudo code he gave me, but, it works perfectly. In his pseudo code, he mentions to loop from first to last minus one, wich I "think" means this: for (size_t i = 0; i < 4; i++)
. But, that doesn't seem to work for me.