can someone help me with a code for a cinema program in C++ using linke lists?
i tried this but there just too much errors.urgent,pliz...


#include<iostream>
/*#include<stdio.h>*/
#include <stdlib.h>
#include<string.h>
using namespace std;

typedef struct{
            char name[30];
            char booking_ID[3];
            int  seats;
    }seat;




    //xxxx  
        typedef struct{
        int t[20][50];
         struct bloc *&suiv;
    }


typedef 
char name;
struct bloc;

 struct bloc*prec,*suiv;




       void initliste(bloc *&tete){
                 tete=NULL;
         }

     booking
       void reserved(bloc*&tete,int x,int k){
           bloc *suiv,*cour,*nouv;
           nouv=new bloc;
           if(k==1){
                nouv->suiv=tete;
                tete=nouv;
                }
                else

                {
                   cour=tete;
                   int i=1;
                   while(i<k && cour!=NULL)
                             {

                               cour=cour->suiv;
                               i++;
                              }
                               if(i==k) {

                               nouv->suiv=cour;
                               }
                     }
          }  







int main(int argc, char *argv[])
{
    char x,O;bloc *suiv,*cour,*nouv;
    int t[20][50],pos;
    struct person
   {
    string name;
    person *next;

   };

  person *head;
  head = NULL;
  string person_name;

/*for (int i = 0; i<20; i++)*/
{
    char name;
    cout << "What is the person's name?";
    cin>>person_name;

    person *newperson;
    person *person_ptr;
    newperson = new person;
    newperson->name = person_name;
    newperson->next = NULL;

    if (head=NULL)
    cout<<"rien affiche";
    else
    {
        person_ptr = head;

        while (person_ptr -> next)
            person_ptr = person_ptr->next;
            person_ptr->next = newperson;
    }

    cout << endl;

 person *Display_ptr;
Display_ptr = head;
while (Display_ptr)
{
    cout << Display_ptr-> name << endl;


    Display_ptr = Display_ptr->next;
    cout << endl;
    cout<<name->next;
    person_ptr = person_ptr->next;
}
while(head!=NULL){ 

  cout<<"donner le nom";
  cin>>name;
 reserved(head,seat,pos)='O';
for(int i=0;i<20;i++)
for(int j=0;j<50;j++)
{



    if (t[][]=='x')
    cout<<"x";
    else
    cout<<t[i][j]<<O;
 // Check to see if seat is taken

if (t[range][siege] == 'X')
   cout << "Sorry, " << row<< seat << " is already taken." << endl;
  else
  {
   cout << "OK, you've got " << row << seat << endl;
   t[row][seat] = 'X';
   seatsTaken++;
}


}    


}  
    system("PAUSE");
    return EXIT_SUCCESS;
}
}

Managed to get rid of the compiler errors. Compiles without warnings too.

#include <iostream>
#include <string>

using namespace std;

int main(int argc, char *argv[])
{
    string name;

    cout << "What is the person's name?";
    cin >> name;
    cout << "Interesting! Thanks for letting me know. Don't forget to visit our cinema!\n";

    return 0;
}

You're welcome.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.