Re: Can't compile this code *****SOLVED****

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


Date: Thu, 25 Nov 2004 13:41:15 +0100

Thank you for the help,

I also use Bruce Eckel, // Much stuff

Deitel and Deitel, // Very good, but I have some problems here too

Josuttis, // requires a new compiler and lots of patience

I program in C since 1996

C++ is new to me.

Could you please comment on this

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

C++ Programming

Teach Yourself C++ in 21 days (4th Edition)
by Jesse Liberty
SAMS 2001. ISBN: 0672322072

International best seller, translated into Chinese,
French, Finnish, Greek, Russian, Slavic, Swedish & Dutch
An in-depth tutorial on the complete language.
Assumes you have no prior programming experience.
Quiz, Q&A and exercises for each chapter.

Over 250,000 copies sold. Recommended by Amazon.

Could you please comment on the quality of the code

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

My ANSI-C favourite is this one

http://www.cse.ucsc.edu/~pohl/abc4.html

A Book on C, Edition 4

by Al Kelley and Ira Pohl

Addison-Wesley ISBN 0-201-18399-4

===

// 4eList1905.cpp
#include <iostream>

using namespace std;

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 = 0; i < howManyTimes; i++)
   {
    DoMeow();
   }
  }

};

int main()
{
 
 Cat *frisky; // frisky is PtrToCat
 frisky = new Cat(5,3);
 frisky->Meow(3);
 return 0;
}



Relevant Pages

  • 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)
  • Re: how to order a struct?
    ... > struct edge { ... > int nodea; ... > int weight; ... bool compare_weights(edge const& lhs, edge const& rhs) { ...
    (alt.comp.lang.learn.c-cpp)