Click here to Skip to main content
16,005,038 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Time display II Pin
Tomasz Sowinski28-May-01 1:11
Tomasz Sowinski28-May-01 1:11 
GeneralRe: Time display II Pin
28-May-01 13:56
suss28-May-01 13:56 
GeneralRe: Time display II Pin
Tomasz Sowinski29-May-01 0:45
Tomasz Sowinski29-May-01 0:45 
GeneralRe: Time display II Pin
Anders Molin28-May-01 2:07
professionalAnders Molin28-May-01 2:07 
Generaltine of decoding one frame Pin
27-May-01 20:27
suss27-May-01 20:27 
Generaltine of decoding one frame Pin
27-May-01 20:27
suss27-May-01 20:27 
GeneralBeginner looking for help Pin
Jason K. Dove27-May-01 19:40
Jason K. Dove27-May-01 19:40 
GeneralRe: Beginner looking for help Pin
Christian Graus27-May-01 19:51
protectorChristian Graus27-May-01 19:51 
Just a few thoughts:

void speak(char* n);
void speak(char* &n);

This is never going to work. The whole idea of a class should mean that it knows how to take care of it's own behaviour. Consider what you're trying to do here, and how this would work/look/be easy to read in a real world application. Each of your classes should have it's own 'speak' function, in the class, which 'speaks' woof or meow. The common way to do this is to have them derive from an abstract base class called Animal, then you can make an Animal * into a Dog or a Cat, and it will know how to speak. If you don't need this behaviour, then just put the speak() methods in the classes and call them from there.

void main()
{
CCat cat1; // 2 instantiations one of cat one of dog
CDog dog1;

As an aside, this comment is unnecessary. A good comment would explain *why* you've created this variables/what they are for/etc., not repeat the obvious.

I hope that helps. If not, just ask again and I'll be happy to further clarify Smile | :)

Christian

#include "std_disclaimer.h"

People who love sausage and respect the law should never watch either one being made.

The things that come to those who wait are usually the things left by those who got there first.

GeneralRe: Beginner looking for help Pin
Jason K. Dove27-May-01 20:13
Jason K. Dove27-May-01 20:13 
GeneralRe: Beginner looking for help Pin
Christian Graus27-May-01 20:25
protectorChristian Graus27-May-01 20:25 
GeneralRe: Beginner looking for help Pin
Jason K. Dove27-May-01 21:05
Jason K. Dove27-May-01 21:05 
GeneralRe: Beginner looking for help Pin
Atul Dharne27-May-01 21:14
Atul Dharne27-May-01 21:14 
GeneralRe: Beginner looking for help Pin
Christian Graus27-May-01 23:14
protectorChristian Graus27-May-01 23:14 
GeneralRe: Beginner looking for help Pin
Dharne Atul28-May-01 3:29
Dharne Atul28-May-01 3:29 
GeneralRe: Beginner [...]; I think this is it! Pin
27-May-01 22:18
suss27-May-01 22:18 
GeneralRe: Beginner [...]; 1 small remark Pin
27-May-01 22:21
suss27-May-01 22:21 
GeneralDatabase question Pin
Christian Graus27-May-01 16:39
protectorChristian Graus27-May-01 16:39 
GeneralRe: Database question Pin
Tomasz Sowinski28-May-01 0:57
Tomasz Sowinski28-May-01 0:57 
GeneralRe: Database question Pin
Tomasz Sowinski28-May-01 1:09
Tomasz Sowinski28-May-01 1:09 
GeneralRe: Database question Pin
Christian Graus28-May-01 1:29
protectorChristian Graus28-May-01 1:29 
GeneralRe: Create the database? Pin
Masaaki Onishi28-May-01 6:46
Masaaki Onishi28-May-01 6:46 
GeneralWinsock Hooking Pin
Crocmort27-May-01 13:25
Crocmort27-May-01 13:25 
GeneralRe: Winsock Hooking Pin
Ghazi H. Wadi28-May-01 7:09
Ghazi H. Wadi28-May-01 7:09 
QuestionWhy does CSimpleArray do this?? Pin
Ben Burnett27-May-01 12:25
Ben Burnett27-May-01 12:25 
AnswerRe: Why does CSimpleArray do this?? Pin
Tim Deveaux28-May-01 10:17
Tim Deveaux28-May-01 10:17 

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.