Hello, I'm new here and need some help understanding the parameters of these two integer types. I recently started programming again and tried to make a hex encoder/decoder. I can't figure out how to make a program analyze two characters in a "char" variable. This is my program so far... Code: int main(int argc, char* argv[]) { int code; int test; int n; test = 0; int maintest; maintest = 0; float word; char yn; n = 0; while (maintest == 0) { fstream file("decode.txt", ios::out); char ch, password[51]; cout << "\nEnter a password (max 8 letters): "; cin >> password; file << password; file.close(); file.open("decode.txt", ios::in); while (test != 1) { cout << "\nHit 1 to Encode, Hit 2 to Decode: "; cin >> code; if (code == 1 || code == 2) { test = test++; } } if (code == 1) { file.get(ch); while (!file.fail()) { cout << hex << ch; n = n++; file.get(ch); } } if (code == 2); { } cout << "\nFinish? (Y or N)"; cin >> yn; switch (yn) { case 'y': maintest = 1; case 'n': break; default : cout << "\nError"; } } return 0; } It says it can't convert char to string. So I've tried to use strings instead of char. but i can't get it to input strings correctly. Any help would be greatly appreciated.
Seriously, fellow, replication of a thread doesn't increase attention, it dilutes it. Worse than that, it annoys people so that they decide not to help, anymore.