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::operator=(in t op)
{
return 1;
}
main()
{
cout<<"Test"<<e ndl;
return 0;
}
I get the following compiler errors:
C:\Code\test\te st.cpp(16) : error C2143: syntax error : missing ';'
before 'tag::id'
C:\Code\test\te st.cpp(16) : error C2501: 'my_struct' : missing
storage-class or type specifiers
C:\Code\test\te st.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::operator=(in t op)
{
return 1;
}
main()
{
cout<<"Test"<<e ndl;
return 0;
}
I get the following compiler errors:
C:\Code\test\te st.cpp(16) : error C2143: syntax error : missing ';'
before 'tag::id'
C:\Code\test\te st.cpp(16) : error C2501: 'my_struct' : missing
storage-class or type specifiers
C:\Code\test\te st.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.
Comment