ISO C++ forbids comparison between pointer and integer [-fpermissive]
shmwrite.cpp:67:9: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
67 | if(shm == -1)
void *shm = NULL;
//建立共享記憶體
shmid = shmget((key_t)1234,sizeof(struct shared_use_st),0666|IPC_CREAT);
if(shmid == FAIL_VALUE)
//if(shm == -1)
{
fprintf(stderr,"shmget failed\n");
exit(EXIT_FAILURE);
}
看錯變數了。和-1直接可以比較大小的。
相關文章
- C++ pointerC++
- rust-quiz:011-function-pointer-comparison.rsRustUIFunction
- Nginx編譯時error: assignment makes pointer from integer without a cast處理Nginx編譯ErrorAST
- The main difference between Java & C++(轉載)AIJavaC++
- C++深度探索系列:智慧指標(Smart Pointer) [二] (轉)C++指標
- opencv遇到NULL pointer(NULL array pointer is passed) 解決方案OpenCVNull
- invalid conversion from ‘LRUCache*‘ to ‘int‘ [-fpermissive] /new的使用
- Tagged Pointer 字串字串
- Comparison of Spring and EJB3Spring
- trait in rust, and comparison with interface in javaAIRustJava
- Null pointer (NULL array pointer is passed) in function cvGetMat, 報這樣的錯NullFunction
- ALL, ANY and SOME Comparison Conditions in SQLSQL
- Samza文件翻譯 : Comparison Introduction
- pointer-events屬性
- Diffrence Between delete and truncatedelete
- length() between oracle and postgresqlOracleSQL
- Relationship between BAPI and RFCAPI
- 學習PLS_INTEGER,BINARY_INTEGER,INTEGER,NUMBER的概念及效能差異
- Comparison of Read Committed and Serializable Isolation (321)MIT
- Comparison of Logical Rowids with Physical Rowids
- CSS3 pointer-eventsCSSS3
- SMART POINTER(智慧指標) (轉)指標
- Move users between domainsAI
- What is the difference between <%, <%=, <%# and -%> in ERB in Rails?AI
- sql語句 between-andSQL
- Transport of Tablespaces Between Databases (59)Database
- Some difference between mysql & oracleMySqlOracle
- 製作ISO檔案 與 提取ISO檔案
- ISO語言程式碼(ISO-639)與國家程式碼(ISO-3166)
- golang unsafe.Pointer與uintptrGolangUI
- error:dereferencing pointer to incomplete typeError
- 採用Tagged Pointer的字串字串
- Leetcode Copy List with Random PointerLeetCoderandom
- [CareerCup] 13.8 Smart Pointer 智慧指標指標
- SAP Retail Differences Between Articles and MaterialsAI
- How to review diffs between commitsViewMIT
- Whats the difference between the v$sql* viewsSQLView
- Difference between business area and profit center