Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
FILE_operations
//gcc 5.4.0 #include <stdio.h> #include <stdlib.h> #include <dirent.h> #include <string.h> unsigned char val; FILE *file_ptr=NULL, *fp_path=NULL; char fpath[100]="C:\\temp\\Code Blocks"; char filenames[500][30]; char path_bool; //-------------------- Reading the filenames --------------- void getfilenames() { DIR *dp; unsigned int i; struct dirent *ep; dp = opendir (fpath); if (dp != NULL) { i=0; memset(filenames,'\0',sizeof(filenames)); while(ep=readdir(dp)) { puts (ep->d_name); strcpy(filenames[i++],ep->d_name); } (void) closedir (dp); //strcpy(filenames[i],not_founded); } else perror ("Couldn't open the directory"); } //------------------------ Path Set ------------------------ void path_set() { printf("The default path is : %s\n\n\r",fpath); printf("Y/N?"); while(1) scanf("%c",&path_bool); if(path_bool=='N') { printf("Enter path:"); scanf("%s",fpath); } printf("The set path is : %s\n\n\r",fpath); } int main(void) { path_set(); return 0; }
run
|
edit
|
history
|
help
0
Rightleftjustfy
BigInteger maxMinSum
selection sort
etapa final de pregunta 2
Minus pointer
pseudo hw
c program for hollow rhombus
Q1.c
Ordered Openmp
Test1