void string_permutation(std::string& x, std::string& permute)
std::printf("%s \n", permute); <<<< other problem
for(int i=0; i<x.size(); ++i)
std::string y = x;
std::string permute2 = permute;
permute2 += x.at(i);
system ("color 0A");
printf("Enter permutation: ");
scanf("%s", input); <<<< here is the problem
std::string x = input;
why won't it let me read the string properly? i don't understand why it just doesn't work.
Please don't tell me to use getline (cin, input); unless there's no other way. I have something against cin and cout.
Also while trying to actually printf my permutation i get the same problem.
Sorry if i seem like a total noob, i'm new to c++ :L
The C io functions (scanf, printf) take char arrays, not string objects. Since string objects do not exist in C.
The C++ versions (cin, cout) take string objects.
So if you want to use strings (which is good, they're useful and less error prone than char arrays), then it's best if you just bite the bullet and use cin/cout. I'm not crazy about iostream myself... it certainly has its share of problems... but don't needlessly shut it down. It's still a good tool.