Skip to content

Instantly share code, notes, and snippets.

@ehzawad
Created May 17, 2022 10:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ehzawad/f6a192ef67392bd302fea8eeef87db45 to your computer and use it in GitHub Desktop.
Save ehzawad/f6a192ef67392bd302fea8eeef87db45 to your computer and use it in GitHub Desktop.
c_input_output
#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