Thread: Debug Problem

  1. #1
    Student drdroid's Avatar
    Join Date
    Feb 2002
    Location
    Montreal, Quebec
    Posts
    669

    Question Debug Problem

    I'm using Borland. Ok, as in the title I'm having debugging problems... or compiler problems... anyway, my compiler (borland) won't run the program, can you tell me whats wrong with it?


    //Filename: dnd.cpp
    //Function: Character Creater
    #include <fstream.h>
    #include <conio.h>
    #include <stdlib.h>
    #include <iostream.h>
    int bdrop(void)
    {
    gotoxy(30,1);
    cout << "RPG PLAYER CREATER V.1";
    gotoxy(1,3);
    cout << "************************************************* *******************************";
    gotoxy(1,23);
    cout << "************************************************* *******************************";
    gotoxy(35,25);
    cout << "BY DR. DROID";
    return 0;
    }
    int main(void)
    {
    int lp=1;
    while(lp!=0)
    {
    clrscr();
    bdrop();
    char y[]="y";
    char yes[]="yes";
    char ysb[]="YES";
    char yb[]="Y";
    char n[]="n";
    char no[]="no";
    char nob[]="NO";
    char nb[]="N";
    char rce[1000];
    char aln[1000];
    char nme[1000];
    char cls[1000];
    char ok[1000];
    gotoxy(1,4);
    cout << "PLAYER NAME: ";
    cin.getline(nme,1000);
    gotoxy(1,6);
    cout << "PLAYER SPECIES: ";
    cin.getline(rce,1000);
    gotoxy(1,8);
    cout << "ALIGNMENT: ";
    cin.getline(aln,1000);
    gotoxy(1,10);
    cout << "CLASS: ";
    cin.getline(cls,1000);
    gotoxy(1,12);
    cout << "IS THIS OK?";
    cin.getline(ok,1000);
    }
    }

  2. #2
    I'm Back
    Join Date
    Dec 2001
    Posts
    556
    i think mains return 0 is missing
    -

  3. #3
    Student drdroid's Avatar
    Join Date
    Feb 2002
    Location
    Montreal, Quebec
    Posts
    669

    Reply

    General Protection Exception... something, a bunch of numbers... Processer Fault

  4. #4
    Registered User
    Join Date
    Mar 2002
    Posts
    1,595
    the while loop is never ending as there is no way to modify lp. This may or may not be a desired effect.

  5. #5
    I'm Back
    Join Date
    Dec 2001
    Posts
    556
    from your program lp!=0.. is the while loop ok?? doesnt get to 0 i think.
    -

  6. #6
    Student drdroid's Avatar
    Join Date
    Feb 2002
    Location
    Montreal, Quebec
    Posts
    669
    I'm just trying to get it to work first

  7. #7
    I'm Back
    Join Date
    Dec 2001
    Posts
    556
    it could be because of too much memory assignment, though i could be wrong,
    -

  8. #8
    Registered User
    Join Date
    Mar 2002
    Posts
    1,595
    after:

    cin.getline(ok,1000);

    place the line:

    lp = 0;

    and between the two closing }'s add the line:

    return 0;

    then try compiling. The while loop should run once then the program should stop.

  9. #9
    Student drdroid's Avatar
    Join Date
    Feb 2002
    Location
    Montreal, Quebec
    Posts
    669
    it could be because of too much memory assignment, though i could be wrong,
    ----------------------------------------------------------------------------
    How could i cure that problem?

  10. #10
    Registered User
    Join Date
    Mar 2002
    Posts
    1,595
    decrease each of [1000] to [100]

  11. #11
    Student drdroid's Avatar
    Join Date
    Feb 2002
    Location
    Montreal, Quebec
    Posts
    669
    thanks...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 5
    Last Post: 11-07-2005, 11:34 PM
  2. searching problem
    By DaMenge in forum C Programming
    Replies: 9
    Last Post: 09-12-2005, 01:04 AM
  3. half ADT (nested struct) problem...
    By CyC|OpS in forum C Programming
    Replies: 1
    Last Post: 10-26-2002, 08:37 AM
  4. binary tree problem - help needed
    By sanju in forum C Programming
    Replies: 4
    Last Post: 10-16-2002, 05:18 AM
  5. Help, Debug Problem
    By drdroid in forum C++ Programming
    Replies: 3
    Last Post: 02-26-2002, 03:50 PM