To: Any c++ programmers who'd care to comment

I am a beginner at c++ but have a very useful program written (by others) in 
gnu c++ which I have worked with for a a while and modified successfully. Now 
have MS.net VS installed and wanted to port.

Alas, compiler errors galore. I've fixed most problems but have what seems to 
be coding errors in the original program which werent detected by gnu c++. BTW, 
there is an MSDN article quite critical of standard-conformance in MS.net c++ 
(ref. cl.exe Episode XIII: Attack of the Standards). Dont know if this is 
relevant here - probably not.

PROBLEM 1:

Declaration in class public section in header file is:
Chromo **myChromoPool; // Chromosome vector
Problem on this line in class definition:
myChromoPool = new (Chromo *)[popSize];

 The MS error reported is:
error C2143 syntax error: missing ';' before '['

popSize is properly declared and assigned.

PROBLEM 2:

Found the gcc switch "-Weffc++" which reports on style problems. This reports:

gene.h:15: warning: `class Gene' has pointer data members
gene.h:15: warning:   but does not override `Gene(const Gene&)'
gene.h:15: warning:   or `operator=(const Gene&)'

Any clues on what this means? There are no CONST declarations  in gene.h, so am 
guessing there is some sort of implicit declaration.

Any references to on-line docs on c++ coding practice or "deciphering compiler 
error messages for dummies"?

thanks
Phil.

Reply via email to