D
Dark Knight
Hello,
I am trying to create a linklist program and I am running into a problem
with this line:
llrecord linklist::find(char ctemp[])
I get three compile errors:
error C2143: syntax error: missing ';' before 'tag::id'
error C2501: 'llrecord':missing storage-class or type specifiers
fatal error C1004: unexpected end of file found
all three are on that line in my linklist.cpp file
thanks in advance
Stephen
now the files
three files are involved assembly.cpp, linklist.cpp, and linklist.h
assembly.cpp:
#include <iostream.h>
#include <fstream.h>
#include <iomanip.h>
#include <stdio.h>
#include <string.h>
// $C000 = 46152
int main()
{
ifstream infile("temp.txt");
return 0;
}
linklist.cpp
#include "linklist.h"
#include <stdio.h>
#include <string.h>
linklist::linklist()
{
char ctemp[5]={"zzzz"};
head=new llrecord;
strcpy(head->opcode, ctemp);
head->next=NULL;
}
linklist::~linklist()
{
}
void linklist::insert(llrecord x)
{
llrecord *llcurrent, *previous, *present;
llcurrent=first;
while(strcmp(x.opcode, llcurrent->opcode)>0)
{
previous=llcurrent;
llcurrent=llcurrent->next;
}
present=new llrecord;
strcpy(present->opcode, x.opcode);
strcpy(present->instruction, x.instruction);
present->numBytes=x.numBytes;
present->next=llcurrent;
if(llcurrent==first)
first=present;
else
previous->next=present;
return;
}
llrecord linklist::find(char ctemp[])
{
llrecord temp;
return temp;
}
bool linklist::eols(llrecord *)
{
}
linklist.h
#ifndef linklist_h
#define linklist_h
class linklist
{
public:
struct llrecord
{
char opcode[5];
int numBytes;
char instruction[10];
llrecord *next;
};
linklist();
~linklist();
void insert(llrecord);
llrecord find(char[]);
bool eols(llrecord *);
private:
llrecord *first;
llrecord *head;
};
#endif
I am trying to create a linklist program and I am running into a problem
with this line:
llrecord linklist::find(char ctemp[])
I get three compile errors:
error C2143: syntax error: missing ';' before 'tag::id'
error C2501: 'llrecord':missing storage-class or type specifiers
fatal error C1004: unexpected end of file found
all three are on that line in my linklist.cpp file
thanks in advance
Stephen
now the files
three files are involved assembly.cpp, linklist.cpp, and linklist.h
assembly.cpp:
#include <iostream.h>
#include <fstream.h>
#include <iomanip.h>
#include <stdio.h>
#include <string.h>
// $C000 = 46152
int main()
{
ifstream infile("temp.txt");
return 0;
}
linklist.cpp
#include "linklist.h"
#include <stdio.h>
#include <string.h>
linklist::linklist()
{
char ctemp[5]={"zzzz"};
head=new llrecord;
strcpy(head->opcode, ctemp);
head->next=NULL;
}
linklist::~linklist()
{
}
void linklist::insert(llrecord x)
{
llrecord *llcurrent, *previous, *present;
llcurrent=first;
while(strcmp(x.opcode, llcurrent->opcode)>0)
{
previous=llcurrent;
llcurrent=llcurrent->next;
}
present=new llrecord;
strcpy(present->opcode, x.opcode);
strcpy(present->instruction, x.instruction);
present->numBytes=x.numBytes;
present->next=llcurrent;
if(llcurrent==first)
first=present;
else
previous->next=present;
return;
}
llrecord linklist::find(char ctemp[])
{
llrecord temp;
return temp;
}
bool linklist::eols(llrecord *)
{
}
linklist.h
#ifndef linklist_h
#define linklist_h
class linklist
{
public:
struct llrecord
{
char opcode[5];
int numBytes;
char instruction[10];
llrecord *next;
};
linklist();
~linklist();
void insert(llrecord);
llrecord find(char[]);
bool eols(llrecord *);
private:
llrecord *first;
llrecord *head;
};
#endif