Can't multiply...
-
All the sudden, the compiler is complaining everywhere I've used the * symbol to multiply "The * or -> operator must be applied to a pointer". I don't even have unsafe code enabled so whats going on?
Omnicoder wrote:
All the sudden, the compiler is complaining everywhere I've used the * symbol to multiply "The * or -> operator must be applied to a pointer".
Your expression is wrong; possibly you are trying to multiply a non-numeric value, or an object that does not have an
operator*
overload. Maybe if you showed a few lines of code to demonstrate the problem we can give a more definitive answer. -
Omnicoder wrote:
All the sudden, the compiler is complaining everywhere I've used the * symbol to multiply "The * or -> operator must be applied to a pointer".
Your expression is wrong; possibly you are trying to multiply a non-numeric value, or an object that does not have an
operator*
overload. Maybe if you showed a few lines of code to demonstrate the problem we can give a more definitive answer. -
All the sudden, the compiler is complaining everywhere I've used the * symbol to multiply "The * or -> operator must be applied to a pointer". I don't even have unsafe code enabled so whats going on?
Omnicoder wrote:
whats going on?
You probably have a better chance of figuring that out, unless you would have the extravagance of showing the relevant code. An extremely wild guess: somehow you lost an operand or inserted a '*' and now have two consecutive operators (as in a+*b, or a=*c) :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
-
Omnicoder wrote:
whats going on?
You probably have a better chance of figuring that out, unless you would have the extravagance of showing the relevant code. An extremely wild guess: somehow you lost an operand or inserted a '*' and now have two consecutive operators (as in a+*b, or a=*c) :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
-
if your observations are correct, your IDE must be ill. Try closing and reopening it. If need be, try a reboot too. If that doesn't help, give us specifics: which OS, which IDE, and a small but actual code snippet. :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
-
How about creating a new very simple project with just the above three lines in one function. I am sure it will work. Somewhere in your program * messed up something.
-
if your observations are correct, your IDE must be ill. Try closing and reopening it. If need be, try a reboot too. If that doesn't help, give us specifics: which OS, which IDE, and a small but actual code snippet. :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
-
I don't know any setting that would cause that. I suggest you create a new project, move your source files (mainly the *.cs; and not the csproj and other specials) into it, try to build. If that works, delete the files (csproj and specials) you did not copy. :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages