Can't compile this code

From: Morten Gulbrandsen (Morten.Gulbrandsen_at_rwth-aachen.de)
Date: 11/25/04


Date: Thu, 25 Nov 2004 11:29:51 +0100


#include <iostream>

public class Cat
{
 private:
  int weight;
  int age;

  void DoMeow()
  {
   cout << "Meow\n":
  }

 public:
  Cat::Cat(int theWeight, int theAge)
  {
   weight = weight;
   age = theAge;
  }

  void Meow(int howManyTimes)
  {
   for (int = i; i < howManyTimes; i++)
   {
    DoMeow();
   }
  }

}

int main()
{
 Cat frisky = new Cat(5,3);
 frisky.Meow(3);
}

Got it from here

http://www.libertyassociates.com/pages/Books.htm

http://www.libertyassociates.com/pages/files/TYCPP4eSource.zip

Please help,

Yours Sincerely

Morten Gulbrandsen



Relevant Pages

  • Re: Cant compile this code
    ... | int weight; ... | Cat::Cat(int theWeight, int theAge) ... | Cat frisky = new Cat; ...
    (alt.comp.lang.learn.c-cpp)
  • Re: [PATCH 2/3] RT: Cache cpus_allowed weight for optimizing migration
    ... weight of the task->cpus_allowed mask. ... unsigned int time_slice; ... #ifdef CONFIG_PREEMPT_RCU ...
    (Linux-Kernel)
  • calling methods in a string
    ... //Prompt user to enter age ... String ageString = JOptionPane.showInputDialog(null, "Enter Age:", ... int age = Integer.parseInt; ... //Prompt user to enter weight ...
    (comp.lang.java.help)
  • Help calling methods!
    ... String ageString = JOptionPane.showInputDialog(null, "Enter Age:", ... int age = Integer.parseInt; ... String weightString = JOptionPane.showInputDialog(null, "Enter Weight:", ...
    (comp.lang.java.help)
  • help
    ... String ageString = JOptionPane.showInputDialog(null, "Enter Age:", "Project ... int age = Integer.parseInt; ... String weightString = JOptionPane.showInputDialog(null, "Enter Weight:", ...
    (comp.lang.java.help)