簡體   English   中英

為什么在Visual Studio 6.0中找不到errno?

[英]Why is errno not found in Visual Studio 6.0?

#include <errno.h>  
  /* compress until end of file */
  do {
       strm.avail_in = fread(in, 1, CHUNK, source);
       errno; //<-----DEBUGGER "CXX0017: Error: symbol errno not found"  
       perror("Error:");

      if (ferror(source)) //<--ferror = 32 but there is no string from perror? 
      {
         //error handling

當使用CRT的DLL版本(例如/ MDd)進行構建時,errno是一個宏。 將其轉換為函數調用以獲得errno的共享值。 像這樣修復它:

int err = errno;

因此您可以檢查err的值。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM