-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with hide() in box class #7
Comments
Ok, I was trying to debug this a little, and I can't figure out anything from this point: 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. |
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!! |
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:
![1](https://user-images.githubusercontent.com/25587869/34416733-e18e7a48-ec1a-11e7-9d20-982370cdb32c.JPG)
![2](https://user-images.githubusercontent.com/25587869/34416750-f00ed266-ec1a-11e7-961f-577b84248b2d.JPG)
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:
![3](https://user-images.githubusercontent.com/25587869/34416783-2c8d27b0-ec1b-11e7-8375-d1f5ed435ffd.JPG)
![4](https://user-images.githubusercontent.com/25587869/34416795-35e66ccc-ec1b-11e7-95fe-66930db60607.JPG)
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?
The text was updated successfully, but these errors were encountered: