-
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);
}
}
-
i think mains return 0 is missing
-
Reply
General Protection Exception... something, a bunch of numbers... Processer Fault
-
the while loop is never ending as there is no way to modify lp. This may or may not be a desired effect.
-
from your program lp!=0.. is the while loop ok?? doesnt get to 0 i think.
-
I'm just trying to get it to work first
-
it could be because of too much memory assignment, though i could be wrong,
-
it could be because of too much memory assignment, though i could be wrong,
----------------------------------------------------------------------------
How could i cure that problem?
-
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.
-
decrease each of [1000] to [100]
-