Greeting all,

Peace. I had this error

error C2059: syntax error : ')'

in VS with c++ code, and searched the web and forums for a solution but could not find one. Finally I simply typed in the bracket ")" in the "find key" to search for all of the ) in the document to ensure that they were all in the correct places. Well lo and behold they were not...some were way outside of my visual site--so I missed these dangling brackets.

I just wanted to post a solution that worked for me on daniweb--since this is a very professional site, and I want others who search for a similar solution to find it here. ;)

Peace and cheers.

Recommended Answers

All 5 Replies


Well, I'm glad you found your problem.

@jencas Thank you for adding to the fullness of the information that other people can use should they have similar difficulties.

I like your way of thinking ;) , but in most cases the compiler also mentions where (on which line) the error is located...

Didn't the compiler give the line where there was a missing ')' ?

@ tux4life, yes the compiler did tell me which line it was located on. But simply looking at the line I could not see it--I figured the compiler meant maybe the lines above, who would think it could know(smile). The reason I could not see it, was because I would have had to scroll all the way to the right, and at the time I only was looking at the line that was in view. If I had scrolled it was there in the midst of "outer space" land.

Thanks for your inquiry... my functions tend to stretch because I pass in a lot of parameters, and "GenerallyHaveVeryLongFunctionNames." But this was a first :-O

Sometimes my life is about pleasing the compiler; first God then the compiler :icon_rolleyes:

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.