473,401 Members | 2,127 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

"illegal operand" error

The following code worked perfectly fine until i modified an unrelated part
of the program:
this->dungArea[x][y].mBlocked =
mioS.mio_dungArea[x][y].mFlags & isBlocked;

after that i started getting the error message:
error C2297: '&' : illegal, right operand has type 'bool (__thiscall
cDungeon::*)(int,int)'
Also,
if(this->dungArea[x][y].mBlocked)
mioS.mio_dungArea[x][y].mFlags |= isBlocked;

stopped working with the same kind of error message:
error C2297: '|=' : illegal, right operand has type 'bool (__thiscall
cDungeon::*)(int,int)'

Can anyone help me fix this?
Jul 19 '05 #1
2 6001
"Kostatus" <ko******@hotmail.com> wrote in message
news:bf**********@lust.ihug.co.nz
The following code worked perfectly fine until i modified an
unrelated part of the program:
this->dungArea[x][y].mBlocked =
mioS.mio_dungArea[x][y].mFlags & isBlocked;

after that i started getting the error message:
error C2297: '&' : illegal, right operand has type 'bool
(__thiscall cDungeon::*)(int,int)'
Also,
if(this->dungArea[x][y].mBlocked)
mioS.mio_dungArea[x][y].mFlags |= isBlocked;

stopped working with the same kind of error message:
error C2297: '|=' : illegal, right operand has type 'bool
(__thiscall cDungeon::*)(int,int)'

Can anyone help me fix this?

Looks to me like isBlocked has been defined to be a pointer to a member
function of class cDungeon. Evidently, you can't use such pointers in
conjunction with the & operator.
Jul 19 '05 #2
Kostatus wrote:
The following code worked perfectly fine until i modified an unrelated
part of the program:
this->dungArea[x][y].mBlocked =
mioS.mio_dungArea[x][y].mFlags & isBlocked;

after that i started getting the error message:
error C2297: '&' : illegal, right operand has type 'bool
(__thiscall
cDungeon::*)(int,int)'


Looks to me like isBlocked is not a variable, but a function, so the
compiler converts it into a pointer to it and gives it to the
operator&. Maybe you wanted to call the function instead? So you
probably wanted:

this->dungArea[x][y].mBlocked =
mioS.mio_dungArea[x][y].mFlags & isBlocked();

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: qe_Cui | last post by:
Hello everyone: I am using vb.net 2003, sqlserver2000 database, and windows 2000 professional OS. In the program, I encrypt the login user's userid and passed with RSACryptoServiceProvider....
2
by: Karl Koscher | last post by:
I'm trying to communicate with a USB device using C#. I'm able to determine the device path using P/Invoke and SetupDiGetClassDevs, SetupDiEnumDeviceInterfaces, and SetupDiGetDeviceInterfaceDetail,...
4
by: Ondrej Spanel | last post by:
The code below does not compile with .NET 2003, I get folowing error: w:\c\Pokusy\delegTemplArg\delegTemplArg.cpp(11) : error C2993: 'float' : illegal type for non-type template parameter 'x' ...
1
by: Steve Grahovac | last post by:
I have been having trouble the last few days opening any ASP.NET web forms in the design view in the designer. Every time I clicked on an aspx file I got a message box with the error "Unable to...
0
by: qe_Cui | last post by:
Hello everyone: I am using vb.net 2003, sqlserver2000 database, and windows 2000 professional OS. In the program, I encrypt the login user's userid(is "sa") and passed(is "sa") with...
0
by: Felix Finch | last post by:
I have a perl test program which has about 80 test cases, each of which creates its own schema so I can remove them with DROP SCHEMA xxx CASCADE. Normally each test case creates and drops the same...
134
by: jacob navia | last post by:
Hi Suppose you have somewhere #define BOOL int and somewhere else typedef BOOL int;
3
by: Eckhard Schwabe | last post by:
I only found one post on Google where someone mentions the same problem with a DataSet: XmlDataReader in .Net 1.1 can not read XML files from a path which contains "%10" or "%3f". code to...
2
by: muslimak | last post by:
I have a perl script that throws an error "illegal division by zero" chunk 37. FYI, this script was the one that worked fine two days back. There is no change in the script. Can anyone tell...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.