Okay... first off let me say that I am not a C++ programmer by any means. We have some existing C++ code that has compiled for years using the SunSoft C++ compiler ( 1.x thru to 3.x ). The newest version of the compiler ( 4.x )
does not seem to like the c++ code. Okay now thats done... on to the question
When I go to compile the code I am constantly getting the following returned error message:
The left operand cannot be assigned to.
The line of code is mostly in the form ..... this = next
or something along that line.
This all refers to the 'this' pointer and the changes in the syntax of the language ( so I have been told ).
Basically, anachronism assignment to "this" isn't allowed in C++ 4.0 and C++ 4.0.1.
How do you correct such a problem????
I am unable to find anything regarding such a problem. Can someone please help.
The "this" pointer refers to the current object and as such cannot be reassigned (it's type is "const T*" where T is the object type).
However, if you REALLY want to reassign it you can casting. Either
Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.
In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples. You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.