I receive this error in a c++ program after moving the program from Mac OS X to windows...I was using XCode, I am now using Visual C++...I looked up the error codfe but don't understand how to apply the solution. Here is the solution as stated by microsoft:

A type appears as the right operand of a member-access (.) operator.

This error can be caused by trying to access a user-defined type conversion. Use the keyword operator between the period and type.

The following sample generates C2286:

Copy// C2274.cpp

struct MyClass {
   operator int() {
      return 0;

int main() {
   MyClass ClassName;
   int i = ClassName.int();   // C2274
   int j = ClassName.operator int();   // OK

Here is my code:

struct connectFlush {
	bool trueConnectFlush;
	bool connectFlush;
	int highCard;
	int trueHighCard;
	double odds[3];

connectFlush DetConnectFlush(int c1, int c2, int f1, int f2, int f3, int trn, int rvr, int round, int f1SV, int f2SV, int f3SV, int trnSV, int rvrSV, int cardSV1, int cardSV2, int flushSuitVal, bool trueFlush)
	connectFlush infunc;
	infunc.connectFlush=false;  //C2274
	infunc.trueConnectFlush=false; //C2274
	infunc.highCard=0; infunc.trueHighCard=0; //C2274


return infunc;

The error is thrown for every line above...how do I modify my code to operate under Visual C++?

5 Years
Discussion Span
Last Post by paulmcco

Problem Solved...the declaration for a member of the struct (bool connectFlush) was the same as the name of the struct...I changed the declaration...problem solved

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.