I supposed to make in memory linked list. I thought I did it perfectly. My teacher is kind of the teacher that won't teach you but let you figure it out.. I couldn't figure it out!!! I supposed to make one like this but to manipulated the list. I am losing here...
/*------------------------------------------------------------------
* Assignment 7: FIRST LINKED LIST ASSIGNMENT.
*Worth: 50 points
*Made by: Samuel Georgeo (max11)
create
an in-memory SERIALLY linked-list database program which
displays a menu screen.
-------------------------------------------------------------------*/
#include <stdio.h>
#include <iostream>
#include "/var2/local/include/getch.h"
using namespace std ;
/*-----------------------------------------------------
* MAIN PROGRAM STARTS HERE
-----------------------------------------------------*/
int main(int argc, char *argv[1])
{
char b ;
while(1)
{
putchar('\n') ;
puts("\t\te) Enter a new agent");
puts("\t\tl) List agents in file");
puts("\t\tn) Next Struct in List");
puts("\t\tp) Prev Struct in List");
puts("\t\tq) Quit program");
if (phere) // avoid segfault for nonexistant record
phere->print_rec() ;
putchar('\n') ;
b = getch();
switch(b)
{
case 'e':
if(!p){
p = new prs;
if (!p) exit (-1)
p > next = p > prev = p;
edit_rec (p);
}else{
phere = p > prev;
pnew = new prs;
if(!pnew) exit (-1)
p > prev =pnew;
pnew> next = p;
phere > next
break;
case 'l':
puts("you typed l") ;
break;
case 'n':
phere= phere->getNext() ;
break;
case 'p':
phere= phere->getFrom();
break;
case 'q':
puts("you typed q") ;
return 0 ;
break;
}; // switch case b
}; deletelist ( head );
} // main
The errors I got was this....
error C2143: syntax error : missing ';' before '%'
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
fatal error C1004: unexpected end-of-file found