int programquit()
{
cout << "good bye";
return EXIT_SUCCESS;
}
int main()
{
Bird *pbird = new Bird;
double Height;
double quit;
int Age;
while(true)
{
cout << "Enter the bird's height in inches"<< endl;
cin >> Height;
if(Height<0)
{
programquit();
break;
}
pbird->setHeight(Height);
cout << "Enter the bird's age in years"<< endl;
cin >> Age;
if(Age<0)
{
programquit();
break;
}
pbird->setage(Age);
cout << "The bird is " << pbird->getHeight() << " inches tall\n";
cout << "It's age is " << pbird->getage() << " years old\n";
cout << "Enter any number under 10 to quit\n";
cin >> quit;
if(quit<0||quit<10)
{
programquit();
break;
}
}
delete pbird;
return EXIT_SUCCESS;
}
Ok can anyone tell me what I have done wrong. I know i did'nt prototype. I got lazy and just used "using namespace std;". Instead of std::cout and so on. _________________
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
Posted: Tue Nov 13, 2007 6:08 pm Post subject:
Flyte wrote:
I am disappointed. I came in here looking for a polymorphic code example when all it is is polymorphic classes.
Probably gunna regret posting this link on this site but meh..
-Link removed for good reasons.-
Theres a good amount of virus engines on that site that also include some polymorphic code examples. Should be able to find something to fancy your taste. _________________
- Retired.
Last edited by atom0s on Tue Nov 13, 2007 6:24 pm; edited 1 time in total
Don't worry Wiccaan, I already know how to achieve that. I was just hoping that somebody would post something half useful as the vast majority of threads are not (polymorphism is a great way to undetect a small program from memory scans, hint: Game Guard). But thanks for your consideration anyways.
About the link itself: Most people here will not understand how it works, but you can remove it if you feel you have to.
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
Posted: Tue Nov 13, 2007 6:24 pm Post subject:
Flyte wrote:
Don't worry Wiccaan, I already know how to achieve that. I was just hoping that somebody would post something half useful as the vast majority of threads are not (polymorphism is a great way to undetect a small program from memory scans, hint: Game Guard). But thanks for your consideration anyways.
About the link itself: Most people here will not understand how it works, but you can remove it if you feel you have to.
Heh, from what I've seen on these forums, anything is bound to show up on the forums after linking to open source projects. Anyway, yea link removed for good-measure. _________________
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum