Home > Back-end >  The error C2143: syntax error: missing '{' before' <'
The error C2143: syntax error: missing '{' before' <'

Time:09-27

What is this wrong ah, really can not find out

CodePudding user response:

This, how also get posted code

Is too abstract

CodePudding user response:

Syntax error in & lt; Lack of braces before

let's learn about leaving the country, he should give the travel

CodePudding user response:

The
reference 1 floor? Victor.?? Response:
, this how to also get a sticker code

Is too abstract


#include #include #include #include using namespace std; # define OK 1 # define the ERROR 0 # define OVERFLOW - 2 typedef int the Status; Typedef int ElemType; Struct Book {string id;//ISBNstring name;//title double price;//pricing}; Typedef struct LNode {Book data; Struct LNode * next; } LNode * LinkList; String head_1, head_2 head_3; Int length; The Status InitList_L (LinkList & amp; L) {//2.6 L=new LNode algorithm; L - & gt; NEXT=NULL; return OK; } the Status GetElem_L (LinkList L, int I Book & amp; E) {//algorithm 2.7 int j; LinkList p; P=L - & gt; next; J=1; While (j & lt; I & amp; & P) {p=p - & gt; next; ++j; }if (! P | | j & gt; I) the return ERROR; E=p - & gt; The data; return OK; } LNode * LocateElem_L (LinkList L, int e) {//algorithm 2.8 LinkList p; P=L - & gt; next; While (p& & p-> The data! E)=p=p - & gt; next; Return the p; } the Status ListInsert_L (LinkList & amp; Int L, I, Book & amp; E) {//algorithm 2.9 int j; LinkList p, s; P=L; j=0; While (p & amp; & J & lt; I - 1) {p=p - & gt; next; ++j; }if (! P | | j & gt; I - 1) return the ERROR; S=new LNode; s-> Data=https://bbs.csdn.net/topics/e; S -> next=p -> next; P -> next=s; + + length; return OK; } the Status ListDelete_L (LinkList & L, int I) {//algorithm 2.10 LinkList p, q; int j; P=L; j=0; While ((p -> next) && (j next; ++j; }if (! (p -> next) | | (j> I - 1)) return the ERROR; Q=p -> next; P -> next=q -> next; The delete q; - length; return OK; } void CreateList_H (LinkList & L, int n) {//algorithm 2.11 LinkList p; L=new LNode; L->next=NULL; Length=0; Fstream file; File. The open (" book. TXT "); if (! The file) {cout & lt; <" Not find relevant file, unable to open!" Head_1 & gt;> Head_2 & gt;> Head_3; while (! File. The eof ()) {p=new LNode; The file & gt;> p-> Data. The id & gt;> p-> Data. The name & gt;> p-> Data. The price; p-> Next=L - & gt; next; L - & gt; Next=p; Length++; } the file. The close (); }//CreateList_Fvoid CreateList_R (LinkList & amp; L, int n) {//algorithm 2.12 LinkList p, r; L=new LNode; L - & gt; Next=NULL; R=L; Length=0; Fstream file; File. The open (" book. TXT "); if (! The file) {cout & lt; <"Not find relevant file to open!" Head_1 & gt;> Head_2 & gt;> Head_3; while (! File. The eof ()) {p=new LNode; The file & gt;> p-> Data. The id & gt;> p-> Data. The name & gt;> p-> Data. The price; p-> Next=NULL; R - & gt; Next=p; r=p; Length++; } the file. The close (); } int main () {int a, n, choose; Double price. The Book e; LinkList L, p; Cout & lt; <"1. Establish \ n"; Cout & lt; <"2. Input \ n"; Cout & lt; <"3. \ n values"; Cout & lt; <"4. Find \ n"; Cout & lt; <"5. Insert the \ n"; Cout & lt; <"6. Delete the \ n"; Cout & lt; <"7. Output \ n"; Cout & lt; <"0. Quit \ n \ n"; Choose=1; While (choose!=0) {cout & lt; <"Please select:"; Cin & gt;> Choose; The switch (choose) {case 1: if (InitList_L (L)) cout & lt; <"Successful build list! \ n \ n "; break; Case 2: CreateList_R (L, length); Cout & lt; <"At the end of input book. TXT message \ n \ n"; break; Case 3: cout & lt; <"Please enter a location for values:"; Cin & gt;> a; If (GetElem_L (L, a, e) {cout & lt; <"Find success \ n"; Cout & lt; <"The first" & lt; Price; If (LocateElem_L (L, price)!=NULL) {cout & lt; <"Find success \ n"; Cout & lt; <"The title of the corresponding price for:" & lt; a; Cin & gt;> E.i d & gt;> E.n ame & gt;> E.p rice; If (ListInsert_L (L, a, e)) cout & lt; <"Insert success \ n \ n"; The else cout & lt; <"Insert failed! \ n \ n "; break; Case 6: cout & lt; <"Please input to delete the location of the books:"; Cin & gt;> a; If (ListDelete_L (L, a)) cout & lt; <"Deleted successfully! \ n \ n "; The else cout & lt; <"Delete failed! \ n \ n "; break; Case 7: cout & lt; <"The current information system of books (list) to read: \ n"; P=L - & gt; next; While (p) {cout & lt; Data. The id & lt; <"\ t" & lt; Data. The name & lt; <"\ t" & lt; Data. The price & lt;
This program is running is this error checking and no less

CodePudding user response:

The
reference 3 floor qq_45854701 response:
Quote: reference 1 floor? Victor.?? Response:
, this how to also get a sticker code

Is too abstract


#include #include
  • Related