Menu

I can't input anything when debugging

Help
2007-09-06
2013-04-23
  • huangke2006

    huangke2006 - 2007-09-06

    I am a new to BVRDE,now i have a problem,
    when I debug the input code " char c=getchar() "
    I can't put a char in console output window.
    How the debug can get my input??
    Thanks!!!!

     
    • IceDagger

      IceDagger - 2007-09-06

      The workaround I used is to directly modify 'char c' directly. Using Watch window.

       
    • Bjarke Viksøe

      Bjarke Viksøe - 2007-09-06

      Hi,

      You may also consider using an input file and pipe it as std-in (configure using the project settings; ie. "myapp < input.txt")

      regards
      bjarke

       
    • huangke2006

      huangke2006 - 2007-09-07

      Hi, everybody!

      I have a problem when i am debugging. My code like this:

      int main()
      {
          char c;
          c = getchar();   // breakpoint 1

          switch(c)
              {
              .....
          }
      }

      I do the following steps:
      1. Press "start debug" button
      2. when the program run at the breakpoint 1, I press F11. The problem is here,
         the variable c didn't get anything. Because I did not discover any window by which
         i can input a character from keyboard.

         How can i input something from keyboard(that is stdin) like VC++ when debugging.
         Please help me!
       

       

Log in to post a comment.