Yesterday I wrote a program, everything was fine, it worked fine. Today I decided to finish something in it, as it turned out that now an error appeared there, although the code was not edited by the last “successful” launch.
Now gives such a mistake:
[Error] Expected Unqualified-id Before ‘{‘ Token (Into Maen Announcement).
# include & lt; iostream & gt;
#Include & lt; Cmath & GT;
#Include & lt; String.h & gt;
#Include & lt; stdio.h & gt;
Using Namespace STD;
Class publication
{
PROTECTED: CHAR NAME [30];
float Price;
Public:
void getdata ()
{
COUT & LT; & LT; "Nazvanie Knigi:" & lt; & lt; endl;
CIN & GT; & GT; NAME;
COUT & LT; & LT; "TCENA:" & lt; & lt; endl;
CIN & GT; & GT; Price;
}
Void Putdata ()
{
COUT & LT; & LT; "Nazvanie Knigi:" & lt; & lt; name & lt; & lt; endl;
COUT & LT; & LT; "TCENA:" & lt; & lt; Price & lt; & lt; endl;
}
Virtual void getdata () = 0;
Virtual Void Putdata () = 0;
Virtual bool isoversize () = 0;
Virtual Void GetDat1 () = 0;
Virtual Void Putdat1 () = 0;
};
Class Sales.
{
Protected:
Float x [3];
Public:
Void GetDat ()
{
COUT & LT; & LT; "Skidki (3 Mesyatca):" & lt; & lt; endl;
for (int i = 0; i & lt; 3; i ++)
{
COUT & LT; & lt; i + 1 & lt; & lt; "mesyatc ="; CIN & GT; & gt; x [i];
}
}
Void Putdat ()
{
COUT & LT; & LT; "Skidki (3 Mesyatca):" & lt; & lt; endl;
for (int i = 0; i & lt; 3; i ++)
{
COUT & LT; & lt; i + 1 & lt; & lt; "mesyatc =" & lt; & lt; x [i] & lt; & lt; endl;
}
}
Virtual Void GetDat1 () = 0;
Virtual Void Putdat1 () = 0;
};
Class Book: Public Publication, Public Sales
{
Private:
int st;
Public:
void getdat1 ()
{
Sales :: GetDat ();
}
Void Putdat1 ()
{
Sales :: Putdat ();
}
void getdata ()
{
publication :: getdata ();
COUT & LT; & LT; "KOL-VO STRANIC:" & lt; & lt; endl;
CIN & GT; & GT; ST;
}
Void Putdata ()
{
PUBLICATION :: Putdata ();
COUT & LT; & LT; "KOL-VO STRANIC:" & lt; & lt; ST & LT; & lt; Endl;
}
bool isoversize ()
{
Return (ST & GT; 800)? True: False;
}
};
Class Tape: Public Publication, Public Sales
{
Private:
int m;
Public:
void getdat1 ()
{
Sales :: GetDat ();
}
Void Putdat1 ()
{
Sales :: Putdat ();
}
void getdata ()
{
publication :: getdata ();
COUT & LT; & LT; "KOL-VO MINUT:" & lt; & lt; endl;
CIN & GT; & gt; m;
}
Void Putdata ()
{
PUBLICATION :: Putdata ();
COUT & LT; & LT; "KOL-VO MINUT:" & lt; & lt; m & lt; & lt; endl;
}
bool isoversize ()
{
Return (M & GT; 90)? True: False;
}
};
Class Disk: Public Publication, Public Sales
{
Private:
Char C;
int r;
Public:
void getdat1 ()
{
Sales :: GetDat ();
}
Void Putdat1 ()
{
Sales :: Putdat ();
}
void getdata ()
{
publication :: getdata ();
COUT & LT; & LT; "Tip Zapisi [CD / DVD]?" & lt; & lt; Endl;
CIN & GT; & GT; C;
COUT & LT; & LT; "Razmer?" & lt; & lt; endl;
CIN & GT; & GT; R;
}
Void Putdata ()
{
PUBLICATION :: Putdata ();
COUT & LT; & LT; "Tip Zapisi:";
if (c == 'c') cout & lt; & lt; "CD" & lt; & lt; endl;
ELSE COUT & LT; & LT; "DVD" & lt; & lt; endl;
COUT & LT; & LT; "Razmer:" & lt; & lt; r & lt; & lt; endl;
}
bool isoversize ()
{
if (C == 'C') RETURN (R & GT; 700)? True: False;
ELSE RETURN (R & GT; 2800)? True: False;
}
};
// ================================================ ============ \\
INT MAIN ()
{
Publication * Pubarr [20];
int n = 0;
char ch;
do.
{
COUT & LT; & LT; "Book [b], Tape [T], Disk [D]?" & lt; & lt; Endl;
CIN & GT; & GT; CH;
if (ch == 'b') pubarr [n] = new book;
ELSE IF (CH == 'T') Pubarr [n] = New Tape;
ELSE PUBARR [N] = New Disk;
Pubarr [N] - & gt; getdata ();
Pubarr [N] - & gt; getdat1 ();
N ++;
COUT & LT; & LT; "Continue [Y / N]?" & lt; & lt; endl;
CIN & GT; & GT; CH;
} while (ch == 'y');
int i;
for (i = 0; i & lt; n; i ++)
{
Pubarr [i] - & gt; Putdata ();
Pubarr [i] - & gt; Putdat1 ();
IF (Pubarr [i] - & gt; isoversize ())
COUT & LT; & LT; "Prevyshenie Razmera!" & lt; & lt; endl;
}
Return 0;
}
Answer 1, Authority 100%
Remove at the end of this line
// ====================== ====================================== \\
Two reverse inclined features to be so
// ====================== ======================================
And you all work 🙂
The reason lies in the fact that the symbol of the reverse braid (\
) is a string continued symbol if it stands at the end of the line. All rows ending with the reverse oscitment (\
), followed by a new string symbol immediately, are combined with the following line in the source file, forming logical lines from physical lines. (MSDN)