Problem with printing strings

This doesn't work for some reason. I don't know why, i hope i can get help. It prints nothing
this is just a snippet

1
2
3
4
5
6
7
  string input1
  string output1
  cin >> input1
  if (input1 == "11101000") {
	output1 == ";";
  };
  cout << output1;

Last edited on
Probably because it doesn't compile.
it is just a snippet of my code, my actual code is waaay to long to actually put in here. It does also compile but still has this issue
Last edited on
Well, then maybe input1 is different than "11101000".
Lines 1, 2 and 3 don't have semi-colons, but since you said the code compiles I'm guessing you just forgot.

Line 5 doesn't do anything. You used the comparison operator, '==', when you want the assignment operator '='.
it worked thanks. btw the missung semi-colens are because the part i did not copy from my code and just typed it in there just to... idk why i put those there.
the bug came from my pain of trying to use chars instead of strings
Topic archived. No new replies allowed.