-
August 24th, 2013, 08:07 AM
#1
error C2059: syntax error : '->'
Hi
So im a bit lost in my c++ programming. Not the code init self, but a error I keep getting. I dont know why I keep getting -> error?
Im using Visual Studio ultimate 2010, and I havnt had any problem with it, til now:
Does anyone know why I keep gettin this error or possibly can be written some other way?
Error 1 error C2059: syntax error : '->'
Greatly appreciated!
-
August 24th, 2013, 08:23 AM
#2
Re: error C2059: syntax error : '->'
Victor Nijegorodov
-
August 24th, 2013, 08:36 AM
#3
Re: error C2059: syntax error : '->'
Thanks, but Ive gone through all those, I couldnt find anything on www. This is my only option.
I need help with this error: Error 1 error C2059: syntax error : '->'
Am i typing -> wrong? Or does Visual Studio ultimate 2010 use some other way?
Thanks in advance
-
August 24th, 2013, 08:40 AM
#4
Re: error C2059: syntax error : '->'
Originally Posted by Maygon
Thanks, but Ive gone through all those, I couldnt find anything on www. This is my only option.
I need help with this error: Error 1 error C2059: syntax error : '->'
Am i typing -> wrong? Or does Visual Studio ultimate 2010 use some other way?
Didn't you read my answer?
Originally Posted by VictorN
and, please, use Code tags when you you will post any code snippets!
Victor Nijegorodov
-
August 24th, 2013, 09:04 AM
#5
Re: error C2059: syntax error : '->'
I need someone to help me with this error of mine.
http://speedy.sh/kEjM3/Syntax-error.png
I dont need help with any coding, just an explanation of why this might be happening.
Quite frustrating because i´ve never had any problems writting....... ->.......in any codes of c++ softwares that ive used like codeblocks or dev c++.
Thanks again
-
August 24th, 2013, 09:25 AM
#6
Re: error C2059: syntax error : '->'
Originally Posted by Maygon
I need someone to help me with this error of mine.
http://speedy.sh/kEjM3/Syntax-error.png
I dont need help with any coding, just an explanation of why this might be happening.
Quite frustrating because i´ve never had any problems writting....... ->.......in any codes of c++ softwares that ive used like codeblocks or dev c++.
Thanks again
Good grief dude, how do you expect anybody to tell you what you're doing wrong if you don't show us what you're doing?!?
-
August 24th, 2013, 11:47 AM
#7
Re: error C2059: syntax error : '->'
Originally Posted by Maygon
I dont need help with any coding, just an explanation of why this might be happening.
It is happening because you're using -> where it shouldn't be used.
Quite frustrating because i´ve never had any problems writting....... ->.......in any codes of c++ softwares that ive used like codeblocks or dev c++.
C++ is a computer language that has rules. It isn't a book report where you just "write stuff", and it has nothing to do with codeblocks or dev-C++. Your code violates a C++ rule in some way, and the only way to know is to see the code.
Regards,
Paul McKenzie
-
August 26th, 2013, 07:11 AM
#8
Re: error C2059: syntax error : '->'
Originally Posted by Maygon
I dont need help with any coding, just an explanation of why this might be happening.
Just an explanation of why: Compiler Error C2059
In two words, you put token -> where it does not belong.
Best regards,
Igor
-
August 24th, 2013, 09:22 AM
#9
Re: error C2059: syntax error : '->'
Sh,,,t!
If you do need some help - show the code causing the problem, not the link to something that does not belong to this Forum.
Besides, it is not clear what symbols and from what code page do you use in "->" expression. So, again: post your exact code (use copy/paste, not just typing it in the edit window)
Last edited by VictorN; August 24th, 2013 at 09:26 AM.
Victor Nijegorodov
-
August 24th, 2013, 10:39 AM
#10
Re: error C2059: syntax error : '->'
I dont need help with any coding, just an explanation of why this might be happening.
In your program, you are using -> in a context for which the compiler does not accept -> as a valid symbol.
If the line containing the -> is supposed to be used correctly but the compiler is reporting a problem, I would look at the code before the line reporting the error for problems - or with the variable definition.
As others have pointed out, to provide further specific guidance you need to post the code containing the error line.
Last edited by 2kaud; August 24th, 2013 at 10:46 AM.
All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!
C++23 Compiler: Microsoft VS2022 (17.6.5)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|