Re: [c-prog] warning: 'class Character' has virtual functions but non-virtual destructor

2007-12-01 Thread Michael Sullivan
On Fri, 2007-11-30 at 18:31 -0700, Thomas Hruska wrote: Michael Sullivan wrote: What is a non-virtual destructor? Does this mean that there are virtual destructors too? How do I define one? Would it just be virtual ~Character(); Like that? I have two classes that subclass

Re: [c-prog] a puzzling question.Need your help

2007-12-01 Thread Tsetsbold
If you use int, it is ok. Because int is smaller than double. But if you use double instead of int, it will trouble. [Non-text portions of this message have been removed]

Re: [c-prog] warning: 'class Character' has virtual functions but non-virtual destructor

2007-12-01 Thread Thomas Hruska
Michael Sullivan wrote: On Fri, 2007-11-30 at 18:31 -0700, Thomas Hruska wrote: Michael Sullivan wrote: What is a non-virtual destructor? Does this mean that there are virtual destructors too? How do I define one? Would it just be virtual ~Character(); Like that? I have two classes that

Re: [c-prog] warning: 'class Character' has virtual functions but non-virtual destructor

2007-12-01 Thread Brett McCoy
On Nov 30, 2007 8:35 PM, Michael Sullivan [EMAIL PROTECTED] wrote: I don't suppose there's a .pdf version of that anywhere? I run Linux. .exe files don't work so well for me... You can install on Linux with Wine. -- Brett In the

Re: [c-prog] warning: 'class Character' has virtual functions but non-virtual destructor

2007-12-01 Thread Brett McCoy
On Dec 1, 2007 5:43 AM, Thomas Hruska [EMAIL PROTECTED] wrote: That's one of the things I'm going to fix for Second Edition (the fabled Second Edition is still in the pipeline). In the meantime, what works for most people is to install the EXE on a Windows box and copy the files over (it

[c-prog] a puzzling question(2)

2007-12-01 Thread 赵鹏飞
I write progarms just as follows,if it is ok? #includestdio.h #includemath.h int main() { int number; int a[10]; for(number = 0;number = 9;number++) { a[number] = 4 - (4 / (number + 1)) * pow(-1,number); } return 0; }

Re: [c-prog] Need help

2007-12-01 Thread Brett McCoy
On Dec 1, 2007 7:14 AM, Abhaya Patra. [EMAIL PROTECTED] wrote: Can someone please send me one demo project on C++ in Unix environment. That will be very useful for me. Waiting for your kind cooperation. Take a look on freshmeat.net, thousands of projects, most open source. -- Brett

[c-prog] Need help

2007-12-01 Thread Abhaya Patra.
Hi , Can someone please send me one demo project on C++ in Unix environment. That will be very useful for me. Waiting for your kind cooperation. Thanks, Abhaya. - Save all your chat conversations. Find them online. [Non-text portions of

Re: [c-prog] Need help

2007-12-01 Thread Thomas Hruska
Abhaya Patra. wrote: Hi , Can someone please send me one demo project on C++ in Unix environment. That will be very useful for me. Waiting for your kind cooperation. Thanks, Abhaya. int main(void) { return 0; } -- Thomas Hruska CubicleSoft President Ph: 517-803-4197

Re: [c-prog] Need help

2007-12-01 Thread Thomas Hruska
Abhaya Patra. wrote: Hi , Can someone please send me one demo project on C++ in Unix environment. That will be very useful for me. Waiting for your kind cooperation. Thanks, Abhaya. And now on a more serious note: While it is admirable that you are wanting something to

[c-prog] Calling a superclass constructor

2007-12-01 Thread Michael Sullivan
I have classes Ally and Enemy, both subclassed from Character. How can I use Character's constructor from inside the constructor's of Enemy and Ally? Something similar to super() in Java, but I don't know the syntax...

Re: [c-prog] Calling a superclass constructor

2007-12-01 Thread cod
On 01/12/2007, Michael Sullivan [EMAIL PROTECTED] wrote: I have classes Ally and Enemy, both subclassed from Character. How can I use Character's constructor from inside the constructor's of Enemy and Ally? Something similar to super() in Java, but I don't know the syntax... class Base {

Re: [c-prog] Need help tracking down cause of SegFault

2007-12-01 Thread Brett McCoy
On Dec 1, 2007 5:27 PM, Michael Sullivan [EMAIL PROTECTED] wrote: I know that a segmentation fault is the equivalent of a null pointer exception in Java, but I don't understand why it's happening here. My full code is posted at http://www.espersunited.com/~michael/needhelp.txt . Basically

[c-prog] Need help tracking down cause of SegFault

2007-12-01 Thread Michael Sullivan
I know that a segmentation fault is the equivalent of a null pointer exception in Java, but I don't understand why it's happening here. My full code is posted at http://www.espersunited.com/~michael/needhelp.txt . Basically the problem is this: class battle { private: Ally party[4]; };

Re: [c-prog] Need help tracking down cause of SegFault [SOLVED]

2007-12-01 Thread Michael Sullivan
On Sat, 2007-12-01 at 18:02 -0500, Brett McCoy wrote: On Dec 1, 2007 5:27 PM, Michael Sullivan [EMAIL PROTECTED] wrote: I know that a segmentation fault is the equivalent of a null pointer exception in Java, but I don't understand why it's happening here. My full code is posted at

Re: [c-prog] Need help tracking down cause of SegFault

2007-12-01 Thread Thomas Hruska
Michael Sullivan wrote: I know that a segmentation fault is the equivalent of a null pointer exception in Java, but I don't understand why it's happening here. My full code is posted at http://www.espersunited.com/~michael/needhelp.txt . Basically the problem is this: class battle {

Re: [c-prog] Need help tracking down cause of SegFault

2007-12-01 Thread ed
Michael Sullivan wrote: I know that a segmentation fault is the equivalent of a null pointer exception in Java, but I don't understand why it's happening here. My full code is posted at http://www.espersunited.com/~michael/needhelp.txt . Basically the problem is this: class battle {

[c-prog] Starting out

2007-12-01 Thread roychang3
Hey everyone, I was just wondering if anyone can suggest the best way to learn C/C++. and what books. Thanks!