i did that and it now shows me another error
In function `main':
[Linker error] undefined reference to `Userchange()'
[Linker error] undefined reference to `Members()'
[Linker error] undefined reference to `Passchange()'
[Linker error] undefined reference to `Auth()'
ld returned 1 exit status
#include <iostream.h>
#include <conio.h>
#include<fstream.h>
#include <process.h>
int main()
{
int ch;
char x;
do
{
cout <<"Hello And Welcome To Dsz Cinemas\n";
cout <<"Please Type In The Number Of Your Choice\n";
cout <<"1. Booking Tickets\n";
cout <<"2. Latest Updates\n";
cout <<"3. Gold Membership\n";
cout <<"4. Credits\n";
cin >>ch;
system("cls");
if (ch==3)
{
usingnamespace std;
void Auth(); // what is this doing here? void Members(); // what is this doing here? void Userchange(); // what is this doing here? void Passchange(); // what is this doing here?
string inuser;
string inpass;
string user;
int num = 0;
int ch;
char pass[BUFSIZ];
int i = 0;
string com;
main() // Is this ANOTHER function called main? What are you doing?
{
Your code goes on and on with functions being declared and defined inside other functions and repeated calls to main (which is BAD - do NOT call main yourself) and various other disasters.
Indent your code. Like I have above.
Indent. Your. Code.
You will then be able to see most of these disasters yourself.
i am new to c++ and have just done about 6 months of learning!
those codes is what i have copied from some blogs to make a cinema booking.
so if u would kindly make the necessary changes and print it here i will b thankful
#include <iostream.h>
#include <conio.h>
#include<fstream.h>
#include <process.h>
int main()
{
int ch;
char x;
do
{
cout <<"Hello And Welcome To Dsz Cinemas\n";
cout <<"Please Type In The Number Of Your Choice\n";
cout <<"1. Booking Tickets\n";
cout <<"2. Latest Updates\n";
cout <<"3. Gold Membership\n";
cout <<"4. Credits\n";
cin >>ch;
system("cls");
cout<<"nothing";
getch ();// put members code here
// like a while(){} loop or somethin like that
// comment please
}
cout <<"Our Gold membership is not available at the moment\nPlease try again later\n\n\n\n";
}
else if (ch>4)
cout <<"The number typed in is wrong Dum Dum =P\n\n\n\n";
cout<<"\n\nDo you wish to redo your selection and select another option or exit? (Y/N)\n";
cin>>x;
system("cls");
}
while (x=='Y'||x=='y');
cout <<"Thankyou for choosing Dsz Cinemas!!!\nSorry for any inconvenience\nHope to see you again ^.^ :D\nBye";
getch();
exit(0);
getch();
}
this is the change i made and i got linker errors for
#include <process.h>
int main()
{
int ch;
char x;
do
{
cout <...
Here is the same code, indented:
1 2 3 4 5 6 7 8 9 10
#include <process.h>
int main()
{
int ch;
char x;
do
{
cout <...
See how you can tell by looking what code is inside what set of braces? This makes it much easier to tell when you have, for example, got your do-while loop wrong, or forgotten to put the closing brace on, or started to define a function inside another function.