Thread: I need HELP its very urgent

  1. #1
    Registered User
    Join Date
    Dec 2011
    Location
    Rawalpindi, Pakistan, Pakistan
    Posts
    12

    I need HELP its very urgent

    I've designed a project but it has just two errors. I've to remove these mistakes but i can't do that. I've to show this project to my teacher but after removing errors so please HELP me. Its very URGENT. I'll be very Thank Full.

    I am pasting the code of project here so please remove 2 errors and paste it in reply.
    The Project ​is about Liabrary management.
    It will be better for me to use it in turbo c.so please.

    Code:
    #include<iostream.h>
    #include<conio.h>
    #include<stdio.h>
    #include<process.h>
    #include<string.h>
    #include<iomanip.h>
    
    
    
    
    
    
    //***************************************************************
    
    
    //                   CLASS USED IN PROJECT
    
    
    //****************************************************************
    
    
    
    
    
    
    class book
    
    
    {
    
    
    char bno[6];
    
    
    char bname[50];
    
    
    char aname[20];
    
    
    public:
    
    
    void create_book()
    
    
    {
    
    
    cout<<"\nNEW BOOK ENTRY...\n";
    
    
    cout<<"\nEnter The book no.";
    
    
    cin>>bno;
    
    
    cout<<"\n\nEnter The Name of The Book ";
    
    
    gets(bname);
    
    
    cout<<"\n\nEnter The Author's Name ";
    
    
    gets(aname);
    
    
    cout<<"\n\n\nBook Created..";
    
    
    }
    
    
    
    
    
    
    void show_book()
    
    
    {
    
    
    cout<<"\nBook no. : "<<bno;
    
    
    cout<<"\nBook Name : ";
    
    
    puts(bname);
    
    
    cout<<"Author Name : ";
    
    
    puts(aname);
    
    
    }
    
    
    
    
    
    
    void modify_book()
    
    
    {
    
    
    cout<<"\nBook no. : "<<bno;
    
    
    cout<<"\nModify Book Name : ";
    
    
    gets(bname);
    
    
    cout<<"\nModify Author's Name of Book : ";
    
    
    gets(aname);
    
    
    }
    
    
    
    
    
    
    char* retbno()
    
    
    {
    
    
    return bno;
    
    
    }
    
    
    
    
    
    
    void report()
    
    
    {
        cout<<bno<<setw(30)<<bname<<setw(30)<<aname<<endl;
    }
    
    
    
    
    
    
    };         //class ends here
    
    
    
    
    
    
    
    
    
    
    class student
    
    
    {
    
    
    char admno[6];
    
    
    char name[20];
    
    
    char stbno[6];
    
    
    int token;
    
    
    public:
    
    
    void create_student()
    
    
    {
    
    
    clrscr();
    
    
    cout<<"\nNEW STUDENT ENTRY...\n";
    
    
    cout<<"\nEnter The admission no. ";
    
    
    cin>>admno;
    
    
    cout<<"\n\nEnter The Name of The Student ";
    
    
    gets(name);
    
    
    token=0;
    
    
    stbno[0]='/0';
    
    
    cout<<"\n\nStudent Record Created..";
    
    
    }
    
    
    
    
    
    
    void show_student()
    
    
    {
    
    
    cout<<"\nAdmission no. : "<<admno;
    
    
    cout<<"\nStudent Name : ";
    
    
    puts(name);
    
    
    cout<<"\nNo of Book issued : "<<token;
    
    
    if(token==1)
    {
    
    
    cout<<"\nBook No "<<stbno;
    
    
    }
    
    
    
    
    
    
    void modify_student()
    
    
    {
    
    
    cout<<"\nAdmission no. : "<<admno;
    
    
    cout<<"\nModify Student Name : ";
    
    
    gets(name);
    
    
    }
    
    
    
    
    
    
    char* retadmno()
    
    
    {
    
    
    return admno;
    
    
    }
    
    
    
    
    
    
    char* retstbno()
    
    
    {
    
    
    return stbno;
    
    
    }
    
    
    
    
    
    
    int rettoken()
    
    
    {
    
    
    return token;
    
    
    }
    
    
    
    
    
    
    void addtoken()
    
    
    {token=1;}
    
    
    
    
    void resettoken()
    
    
    {token=0;}
    
    
    
    
    
    
    void getstbno(char t[])
    
    
    {
    
    
    strcpy(stbno,t);
    
    
    }
    
    
    
    
    
    
    void report()
    
    
    {
        cout<<"\t"<<admno<<setw(20)<<name<<setw(10)<<token<<endl;
    }
    
    
    
    
    
    
    };         //class ends here



    I am waiting. PLEASE ANY BODY CAN HELP ME

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    What are the errors?

    By the way, there is no need to keep harping on how urgent this is to you. If I help you now, it is because I want to help you right now. Whether it is urgent or not has no bearing on my choice, and in fact for some people, help for an "urgent" request will be delayed until it is clear that the deadline is over. I have no obligation to help you today even if you will fail if you don't get help today.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    Dec 2011
    Location
    Rawalpindi, Pakistan, Pakistan
    Posts
    12
    Errors are :
    Deceleration Terminated Incorrectly.
    Decleration missing ;

  4. #4
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    Your "show_student()" method is missing a closing brace, which you would have found yourself if the code were properly indented.

    Decide if you want to program C or C++.
    Indent your code.
    Drop Turbo C. Use Code::Blocks or Microsoft Visual Studio Express or anything else from this millenium.
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  5. #5
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Quote Originally Posted by Waqas Asad
    Deceleration Terminated Incorrectly.
    Decleration missing ;
    You probably meant "declaration". Copy and paste the exact error messages.

    Furthermore, you need to indent your code properly and remove unnecessary blank lines. Do not use the gets function: use fgets instead to avoid buffer overflow.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  6. #6
    Registered User
    Join Date
    Dec 2011
    Location
    Rawalpindi, Pakistan, Pakistan
    Posts
    12
    Quote Originally Posted by nvoigt View Post
    Your "show_student()" method is missing a closing brace, which you would have found yourself if the code were properly indented.

    Decide if you want to program C or C++.
    Indent your code.
    Drop Turbo C. Use Code::Blocks or Microsoft Visual Studio Express or anything else from this millenium.
    After using a closing brace and compiling i got success. But now when i was going to run it displayed 1 error message.
    The Message is :
    undefine symbol _main in module C0.ASM

  7. #7
    Registered User
    Join Date
    Dec 2011
    Location
    Rawalpindi, Pakistan, Pakistan
    Posts
    12
    Quote Originally Posted by laserlight View Post
    You probably meant "declaration". Copy and paste the exact error messages.

    Furthermore, you need to indent your code properly and remove unnecessary blank lines. Do not use the gets function: use fgets instead to avoid buffer overflow.
    Only 1 error left:
    undefine symbol _main in module C0.ASM





  8. #8
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    You forgot to define the main function.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  9. #9
    Registered User
    Join Date
    Dec 2011
    Location
    Rawalpindi, Pakistan, Pakistan
    Posts
    12
    Where should i define can you write it? I mean write main function and display with my code.

  10. #10
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    This is not your first project. How about looking it up in your other projects that compiled?
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  11. #11
    Registered User
    Join Date
    Dec 2011
    Location
    Rawalpindi, Pakistan, Pakistan
    Posts
    12
    Actually every thing is &nbsp;ok but it is not running. I just want to find a solution. After fulfilling all the requirements every thing is fine.
    Total Lines compiled : 1893
    but not running
    Last edited by Waqas Asad; 02-16-2012 at 03:24 AM. Reason: error

  12. #12
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    Without a main function, I doubt anything is running. What does your new code look like? What is the output and if it's not the desired output, what is the output you expected instead?
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  13. #13
    Registered User
    Join Date
    Dec 2011
    Location
    Rawalpindi, Pakistan, Pakistan
    Posts
    12
    When i run it. Nothing happens. Neither a mistake nor it working. Can you copy my code and convert it as cpp file and after checking in turbo c. May be you can help me more efficiently.

  14. #14
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    Quote Originally Posted by Waqas Asad View Post
    When i run it. Nothing happens. Neither a mistake nor it working. Can you copy my code and convert it as cpp file and after checking in turbo c. May be you can help me more efficiently.
    If you DO NOT post your updated code; I think the answer is NO for everybody on this forum.

    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  15. #15
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    Your program will NOT run unless it has a main() function defined.

    Did you add a main() function yet, to your program?

    If you did add a main() function, then we need to see the code, to see why it won't run. If you did not yet add a main() function, then you need to add it first, recompile it, and try it again.

    Be sure to save it with the main() function, before you try to run it - just to be safe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Non-Urgent
    By rockyhwc in forum C Programming
    Replies: 13
    Last Post: 05-17-2010, 06:32 PM
  2. Urgent
    By vlad26 in forum Tech Board
    Replies: 4
    Last Post: 11-03-2008, 01:23 PM
  3. need help not too urgent
    By satory in forum C Programming
    Replies: 8
    Last Post: 12-10-2004, 08:19 AM
  4. [URGENT]Please Help ~
    By Th3-SeA in forum C Programming
    Replies: 3
    Last Post: 09-30-2003, 12:58 PM

Tags for this Thread