Created
May 17, 2022 10:21
-
-
Save ehzawad/f6a192ef67392bd302fea8eeef87db45 to your computer and use it in GitHub Desktop.
c_input_output
This file contains 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> | |
#include <stdlib.h> | |
int main(void) | |
{ | |
int is_ok = EXIT_FAILURE; | |
const char* fname = "/tmp/unique_name.txt"; // or tmpnam(NULL); | |
FILE* fp = fopen(fname, "w+"); | |
if(!fp) { | |
perror("File opening failed"); | |
return is_ok; | |
} | |
fclose(fp); | |
return is_ok; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment