c - Create a zero byte file in specific directory -


#include <stdio.h> #include <stdlib.h>  int main() {    file * fp;     fp = fopen ("file.txt", "w+");      fclose(fp);     return(0); } 

the above programs create file . need file needs placed in specific directory. please help

add path parameter of fopen().

fp = fopen ("/path/to/file.txt", "w+"); 

Comments

Popular posts from this blog

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -