Created
February 20, 2026 01:13
-
-
Save bg1bgst333/a859b2491cce655a836b8cca9f4e6534 to your computer and use it in GitHub Desktop.
printf#return_value#negative
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* ヘッダファイルのインクルード */ | |
| #include <stdio.h> /* 標準入出力 */ | |
| /* main関数の定義 */ | |
| int main(void){ | |
| /* 変数の宣言 */ | |
| int ret_e; | |
| /* 標準出力が閉じられている時, printfは失敗する. */ | |
| fclose(stdout); | |
| ret_e = printf("ABCDE\n"); | |
| if (ret_e < 0){ /* 戻り値が負の値の場合は失敗. */ | |
| perror("printf"); | |
| } | |
| else{ | |
| printf("NO ERROR\n"); | |
| } | |
| /* プログラムの終了 */ | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment