Open chiru9670 opened 6 years ago
Ok, I was trying to debug this a little, and I can't figure out anything from this point:
I commented out the main function of hosp.cpp
, and made another main function in ui/test.cpp
, which is as follows:
void main()
{
ui::clrscr();
box menu2(coord(2, 4), 40, 10 );
menu2.settcolor(GREEN);
menu2 << ui::centeralign << "Employee Management" << ui::endl << ui::endl;
menu2.settcolor(WHITE);
int menu2_height;
menu2_height = 10;
// menu2.setheight(menu2_height);
menu2 << "View employee data" << ui::endl;
menu2.settcolor(ui::tcolor);
// menu2 << "Enter employee's id: ";
unsigned long id;
menu2 >> id;
menu2 << ui::endl;
menu2.setexit_button("Submit");
menu2.loop();
menu2.clear();
menu2.setheight(15);
menu2.settcolor(GREEN);
menu2 << ui::centeralign << "Employee Management" << ui::endl << ui::endl;
menu2.settcolor(WHITE);
menu2 << "Employee Details: " << ui::endl;
menu2.settcolor(ui::tcolor);
getch();
menu2.hide();
getch();
menu2.display();
getch();
menu2 << "ID: " << id << ui::endl;
getch();
menu2.hide();
getch();
menu2.display();
getch();
}
The same problem as mentioned in the issue came up here.
Now I commented out the line menu2 << "View employee data" << ui::endl;
. Here, another problem came up; menu2 << "ID: " << id << ui::endl;
doesn't print the line ID: (whatever id is)
at all...
This is quite weird. I'll have to look into it. Your code is alright
Something very, very weird is going on. It seems like Turbo is running out of memory here. I narrowed it down to a place where I figured the problem has to lie. The problem was in a statement that just used new to allocate heap memory, and that statement resulted in another memory space being modified, which I guess is turbo running out of memory and reallocating stuff.
SOMEONE NEEDS TO FIX THIS!! ANY CLUE REGARDING WHAT'S GOING ON WOULD BE HELPFUL
You guys wanna ask some prof at IITD/IITB about this??!!
Asking a prof would be overkill. Let's ask some of the genius coders here. Do you know any?
I asked some people in some groups. Let's see what happens.
And... do you know where can we run turbo c++ here?
Well, I can run it on my roommate's laptop here...
Oioioioioioi
This is the declaration of my box object:
At this point, the output is: as expected. Now when I hide this box, this is the output: as expected. After this, the following code is run:
The output here is: as expected. Now when I hide this box, this is the output: which is highly unexpected. Is there something wrong with my code, or is it something else?