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直接可以比較大小的。
相關文章
- In-depth analysis of the comparison between AT and XA of distributed transactions
- rust-quiz:011-function-pointer-comparison.rsRustUIFunction
- C++ pointerC++
- Nginx編譯時error: assignment makes pointer from integer without a cast處理Nginx編譯ErrorAST
- Nginx VS Traefik ComparisonNginx
- trait in rust, and comparison with interface in javaAIRustJava
- Tagged Pointer 字串字串
- AP(Access Pointer)
- Two Pointer Method
- invalid conversion from ‘LRUCache*‘ to ‘int‘ [-fpermissive] /new的使用
- However small the rewards may seem in comparison
- error: #error This file requires compiler and library support for the ISO C++ 2011 standard.ErrorUICompileC++
- zero-shot-learning-definition-examples-comparison
- Difference between cursor and a ref cursor
- What is the difference between a Homemaker and a Housewife?
- How to review diffs between commitsViewMIT
- pointer-events屬性
- Integer比較
- cd iso
- SAP Retail Differences Between Articles and MaterialsAI
- 1344. Angle Between Hands of a Clock
- CSS3 pointer-eventsCSSS3
- golang unsafe.Pointer與uintptrGolangUI
- PaperRead - Comparison of Fundamental Mesh Smoothing Algorithms for Medical Surface ModelsGo
- 製作ISO檔案 與 提取ISO檔案
- Between validator常用驗證規則
- Leetcode 12 Integer to RomanLeetCode
- Leetcode 13 Roman to IntegerLeetCode
- Leetcode 7 Reverse IntegerLeetCode
- Integer包裝類
- 13. Roman to Integer
- [Java基礎]IntegerJava
- Integer的比較
- div新增cursor:pointer;失效問題。
- LeetCode 138. Copy List with Random PointerLeetCoderandom
- Madden NFL 22's Launch Should be a Touchdown In comparison to NFL 21
- MySQL中BETWEEN子句的用法詳解MySql
- 走進 JDK 之 IntegerJDK