久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      C 中使用 gets() 提示 warning: this program uses gets(), which is unsafe.

      C 中使用 gets() ,編譯時會出現(xiàn)如下警告:

      warning: this program uses gets(), which is unsafe.

      gets() 不安全是因?yàn)槟憬o了他一個緩沖區(qū),但是你卻沒有告訴它這個緩沖區(qū)到底有多大,也不知道輸入的內(nèi)容到底有多大,輸入的內(nèi)容可能超出緩沖區(qū)的結(jié)尾,引起你的程序崩潰。

      解決方法可以使用 fgets 替代:

      char buffer[bufsize];  fgets(buffer, bufsize, stdin);

      實(shí)例:

        // 使用 gets()  char buffer[4096];  gets(buffer);     // 使用 fgets() 替換 gets()  char buffer[4096];  fgets(buffer, (sizeof buffer / sizeof buffer[0]), stdin);  
      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號