Click here to Skip to main content
15,886,963 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Problem with get/set method Pin
Sivyo22-Sep-09 2:17
Sivyo22-Sep-09 2:17 
GeneralRe: Problem with get/set method Pin
David Crow22-Sep-09 2:53
David Crow22-Sep-09 2:53 
GeneralRe: Problem with get/set method Pin
Sivyo22-Sep-09 9:45
Sivyo22-Sep-09 9:45 
AnswerRe: Problem with get/set method Pin
CPallini22-Sep-09 0:59
mveCPallini22-Sep-09 0:59 
GeneralRe: Problem with get/set method Pin
Sivyo22-Sep-09 1:39
Sivyo22-Sep-09 1:39 
QuestionRe: Problem with get/set method Pin
CPallini22-Sep-09 1:59
mveCPallini22-Sep-09 1:59 
AnswerRe: Problem with get/set method Pin
Sivyo22-Sep-09 2:05
Sivyo22-Sep-09 2:05 
GeneralRe: Problem with get/set method Pin
CPallini22-Sep-09 2:28
mveCPallini22-Sep-09 2:28 
Your code is working fine on my system, however I had to do the following modifications, in order to compile it:
Commented out few lines (I haven't all your animal classes Roll eyes | :rolleyes: ), hence
int main(int argc,char* argv[])
{
  Animals *ourAnimals[6];



  Animals *goldfish = new Goldfish();
  //Animals *crocodile = new Crocodiles();
  //Animals *elephant = new Elephants();
  //Animals *gazelles = new Gazelles();
  //Animals *shark = new Sharks();
  //Animals *snakes = new Snakes();


  ourAnimals[0]=goldfish;
  //ourAnimals[1]=crocodile;
  //ourAnimals[2]=elephant;
  //ourAnimals[3]=gazelles;
  //ourAnimals[4]=shark;
  //ourAnimals[5]=snakes;

  string name, gender, weight;

  name = "the Goldfish";
  gender = "Female";
  weight = "One Ounce";

  goldfish -> setName(name);
  goldfish -> setGender(gender);
  goldfish -> setWeight(weight);

}


Added the constructor and destructor for the Animals (misname? Wouldn't be better 'Animal'?) class:
class Animals
{
public:
  Animals(void){};
  virtual ~Animals(void){};
//...



Again and again: use the debugger and have a look at the call stack window.
Smile | :)

If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.

This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke

[My articles]

GeneralRe: Problem with get/set method Pin
Sivyo22-Sep-09 3:18
Sivyo22-Sep-09 3:18 
AnswerRe: Problem with get/set method Pin
Richard MacCutchan22-Sep-09 2:32
mveRichard MacCutchan22-Sep-09 2:32 
QuestionRe: Problem with get/set method Pin
CPallini22-Sep-09 2:35
mveCPallini22-Sep-09 2:35 
AnswerRe: Problem with get/set method Pin
Richard MacCutchan22-Sep-09 6:07
mveRichard MacCutchan22-Sep-09 6:07 
AnswerRe: Problem with get/set method Pin
Sivyo22-Sep-09 3:21
Sivyo22-Sep-09 3:21 
GeneralRe: Problem with get/set method Pin
Richard MacCutchan22-Sep-09 6:05
mveRichard MacCutchan22-Sep-09 6:05 
Questionhow to lock edit box at runtime Pin
jadhavjitendrar21-Sep-09 23:40
jadhavjitendrar21-Sep-09 23:40 
AnswerRe: how to lock edit box at runtime Pin
Code-o-mat21-Sep-09 23:53
Code-o-mat21-Sep-09 23:53 
AnswerRe: how to lock edit box at runtime Pin
CPallini21-Sep-09 23:57
mveCPallini21-Sep-09 23:57 
QuestionHow to create an HBITMAP from a window's HDC? Pin
vcguileaner21-Sep-09 23:35
vcguileaner21-Sep-09 23:35 
AnswerRe: How to create an HBITMAP from a window's HDC? Pin
CPallini21-Sep-09 23:48
mveCPallini21-Sep-09 23:48 
GeneralRe: How to create an HBITMAP from a window's HDC? Pin
vcguileaner21-Sep-09 23:52
vcguileaner21-Sep-09 23:52 
QuestionRe: How to create an HBITMAP from a window's HDC? Pin
CPallini21-Sep-09 23:59
mveCPallini21-Sep-09 23:59 
AnswerRe: How to create an HBITMAP from a window's HDC? Pin
vcguileaner22-Sep-09 0:38
vcguileaner22-Sep-09 0:38 
GeneralRe: How to create an HBITMAP from a window's HDC? Pin
CPallini22-Sep-09 0:52
mveCPallini22-Sep-09 0:52 
GeneralRe: How to create an HBITMAP from a window's HDC? Pin
vcguileaner22-Sep-09 1:51
vcguileaner22-Sep-09 1:51 
GeneralRe: How to create an HBITMAP from a window's HDC? Pin
CPallini22-Sep-09 2:01
mveCPallini22-Sep-09 2:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.