error C2061: syntax error : identifier 'string' - Page 2
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 32

Thread: error C2061: syntax error : identifier 'string'

  1. #16
    Join Date
    Apr 2013
    Posts
    33

    Re: error C2061: syntax error : identifier 'string'

    I understand. So what do I do if I simply wanna run my program without debugging? (assuming there's nothing to debug)

  2. #17
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,009

    Re: error C2061: syntax error : identifier 'string'

    Find menu item (or toolbar button) "start without debugging" and press it.
    But note that you must use debugger, otherwise you won"t be able to find your bugs in code!
    Victor Nijegorodov

  3. #18
    Join Date
    Apr 2013
    Posts
    33

    Re: error C2061: syntax error : identifier 'string'

    I see, F5 does the job.

    Yes I'll keep that in mind, but it is important to be able to just test your program fluently as well.

    Thank you all for the help.

  4. #19
    Join Date
    Dec 2012
    Location
    England
    Posts
    1,993

    Re: error C2061: syntax error : identifier 'string'

    So what do I do if I simply wanna run my program without debugging
    The compiler will produce a .exe file with the name you have specified in the project properties. Open a command prompt window, change to the folder in which the .exe is located and simply type its name. If you no longer need to debug a program, then you can alter the project properties to produce a release build - rather than a debug build - which has optimisations enabled which will make the program execute faster.
    All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

  5. #20
    Join Date
    Apr 2013
    Posts
    33

    Re: error C2061: syntax error : identifier 'string'

    I imagine I'll be developing in Debug Mode. I just develop and run the program fluently and when I encounter bugs I'll start debugging. Isn't it how it's done? Do you guys really press F10 countless times while developing even when there's no need for debugging?

  6. #21
    Join Date
    Dec 2012
    Location
    England
    Posts
    1,993

    Re: error C2061: syntax error : identifier 'string'

    If debugging, you can set break points, watches etc to hone in on the code that isn't doing what is expected or giving problems. Then use F10 to step through the code (or even F11 to step into called functions) to see what is happening. Once you know that the program 'works' to a certain point in the code then a new breakpoint can be set at that place so all the code previous is automatically executed.
    All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

  7. #22
    Join Date
    Apr 2013
    Posts
    33

    Re: error C2061: syntax error : identifier 'string'

    I see, thanks that sounds useful.

  8. #23
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Posts
    11,980

    Re: error C2061: syntax error : identifier 'string'

    Quote Originally Posted by royibernthal View Post
    I imagine I'll be developing in Debug Mode. I just develop and run the program fluently and when I encounter bugs I'll start debugging. Isn't it how it's done? Do you guys really press F10 countless times while developing even when there's no need for debugging?
    There's always a need for debugging, or at least to verify your code is running correctly. I step through just about every line of code I write to make sure it's doing what I think it is. Buggy programs can still give correct results from time to time. Getting the output you expect is no guarantee the code is working properly.

  9. #24
    Join Date
    Apr 2013
    Posts
    33

    Re: error C2061: syntax error : identifier 'string'

    I agree that debugging is needed from time to time, especially after writing some major code, but to execute line after line EVERY single time you run the program sounds very tiring and unnecessary. Sometimes you just make small changes that you know for sure that'll work and just want to see how they look.

  10. #25
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Posts
    11,980

    Re: error C2061: syntax error : identifier 'string'

    Quote Originally Posted by royibernthal View Post
    I agree that debugging is needed from time to time, especially after writing some major code, but to execute line after line EVERY single time you run the program sounds very tiring and unnecessary. Sometimes you just make small changes that you know for sure that'll work and just want to see how they look.
    Who said anything about every line every time?

  11. #26
    Join Date
    Apr 2013
    Posts
    33

    Re: error C2061: syntax error : identifier 'string'

    Well it sounded like that from my point of view, I got the wrong impression then.

  12. #27
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Posts
    11,980

    Re: error C2061: syntax error : identifier 'string'

    Quote Originally Posted by royibernthal View Post
    Well it sounded like that from my point of view, I got the wrong impression then.
    I'll step through each function I write, but when I'm sure it's doing what it's supposed to, there's no reason to visit it again. It's too easy to use a < instead or a > or to leave out a ! in an if statement to assume you get it right the first time. I work on very large programs and it's not reasonable to assume our testers will catch everything. The programmer has to put some effort into it too.

  13. #28
    Join Date
    Apr 2013
    Posts
    33

    Re: error C2061: syntax error : identifier 'string'

    Yes I understand what you're talking about. We look at it the same way really. Thanks again.

  14. #29
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,009

    Re: error C2061: syntax error : identifier 'string'

    Quote Originally Posted by royibernthal
    ... but to execute line after line EVERY single time you run the program sounds very tiring and unnecessary
    Quote Originally Posted by royibernthal View Post
    Well it sounded like that from my point of view, I got the wrong impression then.
    You don't need to "execute line after line EVERY single time". You have a choice: using F10, F11, Shift+F11, Ctrl]F10, ... Just read the documentation about debugging and its commands.
    Victor Nijegorodov

  15. #30
    Join Date
    Apr 2013
    Posts
    33

    Re: error C2061: syntax error : identifier 'string'

    Okay, I will.

Page 2 of 3 FirstFirst 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center