linux getline 忽略行尾换行符—strip trailing newline



点击(此处)折叠或打开

  1. /* strip trailing newline */
  2. for (int i = 0; i < strlen(inputline); i++)
  3. {
  4.     if ( inputline[i] == '\n' || inputline[i] == '\r' )
  5.         inputline[i] = '\0';
  6. }

<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
阅读(132) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~
评论热议
posted @ 2016-02-01 00:00  张同光  阅读(325)  评论(0编辑  收藏  举报