Need help with do while loops

Okay so I've been getting along with C++ okay so far (came from a java background), but I think I've hit a brick wall and have been doing so for days.
I'm trying to create a really basic menu within the console, the menu needs to say open the file menu and then return back to a menu choice when the user is finished searching the contents of a file menu.
I have what I thought was the basic idea but now I'm not so sure, the code gets stuck in the if loop for File by the looks of it...
I think I just need pointing in the right direction! I have looked at a switch statement but I'm more concerned as to why this won't work with a do while loop.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
  int _tmain(int argc, _TCHAR* argv[])
{
	char menchoice1 = 0;
	char menchoice = 0;
	char back;

	do 
	{
		cout << ("FILE = F   EDIT = E   QUIT = Q   Return = R \n\n");
		cin >> menchoice;
		
		if (menchoice == 'f' || 'F')
		{
			system("cls");
			cout << "File*";
			cout << "\n This is the file menu...\n";
			cout << "\n\n Press the 'r' key to return";
			cin >> back;
			if (back == 'r' || 'R')
			{
				system("cls");
			}
		

		}
		else if (menchoice == 'e' || 'E')
		{
			system("cls");
			cout << "\n\n Edit*";
			cout << "\n\n This is the edit menu...\n";
			cout << "\n\n Press the 'r' key to return";
			cin >> back;
			if (back == 'r' || 'R')
			{
				back = 0;
				system("cls");
			}
		}
		else if (menchoice == 'q' || 'Q')
		{
			system("cls");
			system("exit");
		}
		else
		{
			cout << "T\n\ That is not a valid input";
			menchoice = menchoice1;
		}

		menchoice = menchoice1;

	}
	while (menchoice = 'f' || 'e' || 'r');
The way logic works in C++:

line 12: if (menchoice == 'f' || 'F')
should be
if (menchoice == 'f' || menchoice == 'F')
The same problem in the other 5 if blocks.

Also in the case of while:
line 53: while (menchoice = 'f' || 'e' || 'r');
should be
while (menchoice == 'f' || menchoice == 'e' || menchoice == 'r');
Notice that you also used assignment (=) instead of comparison (==) This will not do what you're hoping.
Thank you so much tipaye. Really appreciate the help!
Topic archived. No new replies allowed.