error

so i'm getting this errors:
106:1: error: expected 'while' at end of input
106:1: error: expected '(' at end of input
106:1: error: expected primary-expression at end of input
106:1: error: expected ')' at end of input
106:1: error: expected ';' at end of input
106:1: error: expected ')' at end of input

here is my code:

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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#include <iostream>
#include <fstream>
#include <string>
#include <stdlib.h>
#include <conio.h>
using namespace std;

int main()
{
	ofstream pass;
	ofstream username;
	ifstream admin1;
	ifstream pass1;
	ifstream username1;
	char ad, ps, repeat, menu;
	string admin, password, user;
	
	string psi;
	string admini;
	string useri;
	
	pass.open("pass.txt");
	username.open("user.txt");
	admin1.open("admin.txt");
	pass1.open("pass.txt");
	username1.open("user.txt");
	
	do{
		
		cout <<"select one of the following options:\n";
		cout <<"F1 register\n";
		cout <<"F2 login\n";
		cout <<"ESC exit\n";
		
		cin >> menu;
		
		if ( menu == 112 ){
			
			cout <<"enter the admin password:";
			ad = _getch();
			while(ad != 13){
				admin.push_back(ad);
				cout << '*';
				ad = _getch();
			}
			if (admin1.is_open()){
				while (!admin1.eof()){
					getline(admin1,admini);
				}
				admin1.close();
			}
			if (admin == admini){
				
				cout << "enter your username:";
				cin >> user;
				cout << "enter your password:";
				ps = _getch();
				while(ps != 13){
					password.push_back(ps);
					cout << '*';
					ps = _getch();
				}
				if (username.is_open()){
					username << user << endl;
					username.close();
				}
				if (pass.is_open()){
					pass << password << endl;
					pass.close();
				}
				cout << "to return to the menu press BACKSPACE\n";
				cin >> repeat;
			}
		}
		if (menu == 113){
			
			cout << "enter your usermame:";
			cin >> user;
			if (username1.is_open()){
				while(!username1.eof()){
					getline(username1,useri);
				}
				username1.close();
			}
			cout << "enter your password:";
			cin >> password;
			if (pass1.is_open()){
				while(!pass1.eof()){
					getline(pass1,psi);
				}
				pass1.close();
			}
			if (user==useri && password==psi){
				cout << "your data is correct!";
				/* inserir função para continuar o programa*/
			}
			else {
				cout << "your data is incorrect. press BACKSPACE to return to the menu\n";
				cin >> repeat;
			}
		}
		if (menu == 27){
			return 0;
		}
	while(repeat == 8);
}
sorry about the trouble. i've already figured the out what was wrong
your do-while is missing "}"
Topic archived. No new replies allowed.