Expected declaration before '}' token

closed account (1v5E3TCk)
There is not any expected '{' token but its giving that error. Can anyone help me?

Full error: Line 336-1 [Error] expected declaration before '}' token

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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
  void hamle( string dama[ ][ 8 ] , int oyuncu)
{
	int a;
	int b;
	
	cout<< "Oynamak istediginiz yerin yatay numarasini girin.";
	cin>> a;
	
	cout<< "Oynamak istediginiz yerin dikey numarasini girin.";
	cin>> b;
	
	  if( oyuncu == 1)
	  {
	    if ( ( (a == x-1 || a == x+1) && b == y ) || ( b == y-1 && a == x ))
	    	{
	    		if ( dama[ b ][ a ] == "   ")
	    		{
	    			 dama[ b ][ a ] = " S ";
	    			 dama[ y ][ x ] = ":::";
	    		}
	    		
	    		if ( dama[ b ][ a ] == ":::")
	    		{
	    			 dama[ b ][ a ] = ":S:";
	    			 dama[ y ][ x ] = "   ";
	    		
				}
	    		
	    	}
	    	
	    if ( (a == x-2 && b == y) && (dama[ b ][ x-1 ] == ":K:" || dama[ b ][ x-1 ] == " K " ) )
	    {
	    	string temp;
	    	temp = dama[ b ][ a ];
	    	dama[ b ][ a ] = dama[ y ][ x ];
	    	dama[ y ][ x ] = temp;
	    	
	    	if( dama[ b ][ x-1 ] == ":K:" )
	    	{
	    		dama[ b ][ x-1 ] = ":::";
	    	}
	    	
	    	if( dama[ b ][ x-1 ] == " K " )
	    	{
	    		dama[ b ][ x-1 ] = "   ";
	    	}
	    	
		}
		
		if ( (a == x+2 && b == y) && (dama[ b ][ x+1 ] == ":K:" || dama[ b ][ x+1 ] == " K " ) )
	    {
	    	string temp;
	    	temp = dama[ b ][ a ];
	    	dama[ b ][ a ] = dama[ y ][ x ];
	    	dama[ y ][ x ] = temp;
	    	
	    	if( dama[ b ][ x+1 ] == ":K:" )
	    	{
	    		dama[ b ][ x+1 ] = ":::";
	    	}
	    	
	    	if( dama[ b ][ x+1 ] == " K " )
	    	{
	    		dama[ b ][ x+1 ] = "   ";
	    	}
	    	
		}
		
		if ( b == y-2 && (dama[ y-1 ][ a ] == ":K:" || dama[ y-1 ][ a ] == " K " ))
        { 
        	string temp;
	    	temp = dama[ b ][ a ];
	    	dama[ b ][ a ] = dama[ y ][ x ];
	    	dama[ y ][ x ] = temp;
	    	
	    	if( dama[ y-1 ][ a ] == ":K:" )
	    	{
	    		dama[ y-1 ][ a ] = ":::";
	    	}
	    	
	    	if( dama[ y-1 ][ a ] == " K " )
	    	{
	    		dama[ y-1 ][ a ] = "   ";
	    	}
        }
       
        }
       if( oyuncu == 2)  
	    {
	    if ( ( (a == x-1 || a == x+1) && b == y ) || ( b == y+1 && a == x ))
	    	{
	    		if ( dama[ b ][ a ] == "   ")
	    		{
	    			 dama[ b ][ a ] = " K ";
	    			 dama[ y ][ x ] = ":::";
	    		}
	    		
	    		if ( dama[ b ][ a ] == ":::")
	    		{
	    			 dama[ b ][ a ] = ":K:";
	    			 dama[ y ][ x ] = "   ";
	    		
				}
	    		
	    	}
	    	
	    if ( (a == x-2 && b == y) && (dama[ b ][ x-1 ] == ":S:" || dama[ b ][ x-1 ] == " S " ) )
	    {
	    	string temp;
	    	temp = dama[ b ][ a ];
	    	dama[ b ][ a ] = dama[ y ][ x ];
	    	dama[ y ][ x ] = temp;
	    	
	    	if( dama[ b ][ x-1 ] == ":S:" )
	    	{
	    		dama[ b ][ x-1 ] = ":::";
	    	}
	    	
	    	if( dama[ b ][ x-1 ] == " S " )
	    	{
	    		dama[ b ][ x-1 ] = "   ";
	    	}
	    	
		}
		
		if ( (a == x+2 && b == y) && (dama[ b ][ x+1 ] == ":S:" || dama[ b ][ x+1 ] == " S " ) )
	    {
	    	string temp;
	    	temp = dama[ b ][ a ];
	    	dama[ b ][ a ] = dama[ y ][ x ];
	    	dama[ y ][ x ] = temp;
	    	
	    	if( dama[ b ][ x+1 ] == ":S:" )
	    	{
	    		dama[ b ][ x+1 ] = ":::";
	    	}
	    	
	    	if( dama[ b ][ x+1 ] == " S " )
	    	{
	    		dama[ b ][ x+1 ] = "   ";
	    	}
	    	
		}
		
		if ( b == y+2 && (dama[ y+1 ][ a ] == ":S:" || dama[ y+1 ][ a ] == " S " ))
        {}// i cant see that '}' token in dec-++. how can i correct it 
        	string temp;
	    	temp = dama[ b ][ a ];
	    	dama[ b ][ a ] = dama[ y ][ x ];
	    	dama[ y ][ x ] = temp;
	    	
	    	if( dama[ y+1 ][ a ] == ":S:" )
	    	{
	    		dama[ y+1 ][ a ] = ":::";
	    	}
	    	
	    	if( dama[ y+1 ][ a ] == " S " )
	    	{
	    		dama[ y+1 ][ a ] = "   ";
	    	}
        }
}
      
} //That is the line which gives error
Last edited on
closed account (30X1hbRD)
Just wondering, but have you tried deleting the last } bracket?
closed account (1v5E3TCk)
thanks for helping but that was not the problem. i copied that code and paste it to my editor and delete the bracket which ı marked at line 146 thanks
What do you want us to do? You already solved your problem.
Line 146 and 164.



closed account (1v5E3TCk)
after asking it there i saw the } bracket there which i hadn't able to see in ide.
Topic archived. No new replies allowed.