Erasing using backspace control character

后端 未结 4 575
一个人的身影
一个人的身影 2020-12-02 19:09

I am trying to use the backspace control character \'\\b\' to erase trailing commas at the end of line. Although it works in cases where there is no other outpu

4条回答
  •  旧时难觅i
    2020-12-02 20:08

    yeah the \b will only move the curse so when you end the line it just moves it back to the end of the line. so to actually erase the last part have a space after \b to actually erase the last comma. example: cout<<"\b ";

提交回复
热议问题