Sign in to follow this  

MultiLinked List Student DataBase

This topic is 4483 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello... I've been writing a multilinked list student data base header file. I am doing everything correct as according to my apparent knowledge but when i check it for compiling i get 31 errors ... I'm using Dev-C++ and OS is Win-XP Can any one help me? Here's the code:
#ifndef _MULTILIST_H
#define _MULTILIST_H

#include <iostream>
using namespace std;
#include <conio.h>

class MultiList{

      struct Student;
      struct Courses;
      struct InterNode;

      public:
             Student nextStd{void}{

             }
             Courses nextCourse{void}{
             }

             insertData{

              while( ch != 'Y' || ch != 'y' )
                  {      cout << "Enter Student's ID : "
                         cin >> stdPtr->sID;
                         cout << "Enter Name of Student : "
                         cin >> stdPtr->sName;

                         while( ch != 'Y' || ch != 'y' )
                         {
                             cout << "Enter The Course's ID : ";
                             cin >> coursesPtr->cID;
                             cout << "Enter  Course's Name : "
                             cin >> coursesPtr->cName;
                             cout << "Do you want to add more courses : " << endl
                                  << "Press Y to add courses" << endl
                                  << "Press any other key to quit entering" << endl;
                             ch = getch();
                             if( ch == 'Y' || ch == 'y' )
                                 nextCourse();
                         }

                         cout << " ---- Finished entering courses now -----" << endl;
                         ch = 'N';
                         cout << "Do you want to add more courses : " << endl
                             << "Press Y to add courses" << endl
                             << "Press any other key to quit entering";
                        ch = getche();


                  }


             }

      private:
              Student* stdPtr;
              stdPtr = new Student;
              Courses* coursesPtr;
              coursesPtr = new Courses;
              char ch;

};


MultiList :: Student {

         char* sID;
         char* sName;
         InterNode* newStd;

}


MultiList :: Courses{

          char* cID;
          char* cName;
          InterNode *newCourse;
}


MultiList :: InterNode{
          Student* newStudent;

};

Share this post


Link to post
Share on other sites
Well all the other developers out there and I could probibly help more if you posted your errors.

=)

Well like I said if you have 31 erros post em but one thing I notice is that insertData has no parenthesis or return type.

Share this post


Link to post
Share on other sites
Here are the 31 Errors, that i get when i try to compile it ...



12 g:\langua~1\general\datast~1\multil~1\newfol~1\newclass.cpp
syntax error before `{'

12 g:\langua~1\general\datast~1\multil~1\newfol~1\newclass.cpp
missing ';' before right brace

15 g:\langua~1\general\datast~1\multil~1\newfol~1\newclass.cpp
syntax error before `{'

18 g:\langua~1\general\datast~1\multil~1\newfol~1\newclass.cpp
syntax error before `{'

23 g:\langua~1\general\datast~1\multil~1\newfol~1\newclass.cpp
syntax error before `<'

29 g:\langua~1\general\datast~1\multil~1\newfol~1\newclass.cpp
syntax error before `>'

30 g:\langua~1\general\datast~1\multil~1\newfol~1\newclass.cpp
syntax error before `<'

32 g:\langua~1\general\datast~1\multil~1\newfol~1\newclass.cpp
syntax error before `<'

35 g:\langua~1\general\datast~1\multil~1\newfol~1\newclass.cpp
ANSI C++ forbids declaration `ch' with no type

35 g:\langua~1\general\datast~1\multil~1\newfol~1\newclass.cpp
implicit declaration of function `int getchar(...)'

36 g:\langua~1\general\datast~1\multil~1\newfol~1\newclass.cpp
parse error before `if'

40 g:\langua~1\general\datast~1\multil~1\newfol~1\newclass.cpp
syntax error before `<'

41 g:\langua~1\general\datast~1\multil~1\newfol~1\newclass.cpp
ANSI C++ forbids declaration `ch' with no type

41 g:\langua~1\general\datast~1\multil~1\newfol~1\newclass.cpp
redefinition of `int ch'

35 g:\langua~1\general\datast~1\multil~1\newfol~1\newclass.cpp
`int ch' previously defined here

42 g:\langua~1\general\datast~1\multil~1\newfol~1\newclass.cpp
syntax error before `<'

45 g:\langua~1\general\datast~1\multil~1\newfol~1\newclass.cpp
ANSI C++ forbids declaration `ch' with no type

45 g:\langua~1\general\datast~1\multil~1\newfol~1\newclass.cpp
redefinition of `int ch'

41 g:\langua~1\general\datast~1\multil~1\newfol~1\newclass.cpp
`int ch' previously defined here

45 g:\langua~1\general\datast~1\multil~1\newfol~1\newclass.cpp
multiple initializations given for `ch'

48 g:\langua~1\general\datast~1\multil~1\newfol~1\newclass.cpp
parse error before `}'

55 g:\langua~1\general\datast~1\multil~1\newfol~1\newclass.cpp
ANSI C++ forbids declaration `stdPtr' with no type

55 g:\langua~1\general\datast~1\multil~1\newfol~1\newclass.cpp
parse error before `;'

56 g:\langua~1\general\datast~1\multil~1\newfol~1\newclass.cpp
syntax error before `*'

57 g:\langua~1\general\datast~1\multil~1\newfol~1\newclass.cpp
ANSI C++ forbids declaration `coursesPtr' with no type

57 g:\langua~1\general\datast~1\multil~1\newfol~1\newclass.cpp
parse error before `;'

58 g:\langua~1\general\datast~1\multil~1\newfol~1\newclass.cpp
conflicting types for `char ch'

45 g:\langua~1\general\datast~1\multil~1\newfol~1\newclass.cpp
previous declaration as `int ch'

60 g:\langua~1\general\datast~1\multil~1\newfol~1\newclass.cpp
parse error before `}'

63 g:\langua~1\general\datast~1\multil~1\newfol~1\newclass.cpp
parse error before `{'

67 g:\langua~1\general\datast~1\multil~1\newfol~1\newclass.cpp
syntax error before `*'


Share this post


Link to post
Share on other sites
You are missing semicolons on several lines, and you are using curly-brackets for argument argument lists when you should be using parenthesis. Your insertData function is also missing an argument list and return type.

I suggest you find a good introductory book on C++.

Share this post


Link to post
Share on other sites
Sign in to follow this