Re: inconsistent compiler behaviour !!!

I am not going to analyse the error messages.  You are inconsistent
yourself in your code:

>
> #include <iostream.h>

This is an old header, non-standard.  Must be

#include <iostream>

> #pragma hdrstop

This is a non-standard element, if you use it, write to
your compiler newsgroup, or remove it.

> #include <string>

This is a new header, standard.  OK.

> using namespace std;
>
> class v
> {
> public:
> string name;
> int value;
> v() {value = 0;}
> v(string Name, int Value = 0) {name = Name; value = Value;}

The preferrable way of initialising member data is using
initialiser lists:

v() : value(0) {}  // 'name' is default-initialised
v(sting Name, int Value = 0) : name(Name), value(Value) {}

Although, it must have no effect on the compiler behaviour.

> };
>
> main()

This is plain WRONG.  Must be

int main()

> {
> v V("s", 1);
> }
>

Now, correct the errors and try again.  Then, if you still get
errors, post again.




--- GoldED/386 2.42.G0614+
 * Origin: Everything goes the bach runter ... 
 * http://escortservice-www.cc

Received on Tuesday, 14 September 2004 17:20:26 UTC