D
Daniel Allex
I have the following code:
#include "iostream.h"
class a
{
public:
struct my_struct
{
int one;
int two;
};
my_struct operator= (int);
};
my_struct a:perator=(int op)
{
return 1;
}
main()
{
cout<<"Test"<<endl;
return 0;
}
I get the following compiler errors:
C:\Code\test\test.cpp(16) : error C2143: syntax error : missing ';'
before 'tag::id'
C:\Code\test\test.cpp(16) : error C2501: 'my_struct' : missing
storage-class or type specifiers
C:\Code\test\test.cpp(16) : fatal error C1004: unexpected end of file
found
If I change the return type to and int or some other defined type for
the overloaded operator, it compiles fine.
#include "iostream.h"
class a
{
public:
struct my_struct
{
int one;
int two;
};
my_struct operator= (int);
};
my_struct a:perator=(int op)
{
return 1;
}
main()
{
cout<<"Test"<<endl;
return 0;
}
I get the following compiler errors:
C:\Code\test\test.cpp(16) : error C2143: syntax error : missing ';'
before 'tag::id'
C:\Code\test\test.cpp(16) : error C2501: 'my_struct' : missing
storage-class or type specifiers
C:\Code\test\test.cpp(16) : fatal error C1004: unexpected end of file
found
If I change the return type to and int or some other defined type for
the overloaded operator, it compiles fine.