Met stomheid geslagen snap ik totaal niet waarom ik de directory gerelateerde header files niet kan includen.
Ik werk met Visual C++ 6.0 Enterprise Edition SP5 op Windows XP SP1.
Nu wil ik de volgende code, gevonden op http://poli.cs.vsb.cz/c/help/dir0.htm#LBL11 kunnen uitvoeren:
Hele tijd gegoogled en geGotterd, maar vind niet de goede topics over dir.h, dirent.h etc...
Error die ik krijg: can't open include file: 'dir.h'
Komt dit nu omdat bestand helemaal niet bij VC++ standaard zit en ik hem dus moet downloaden en in project map moet stoppen? Of is het een standaard header file van een niet-windows OS?
Ik werk met Visual C++ 6.0 Enterprise Edition SP5 op Windows XP SP1.
Nu wil ik de volgende code, gevonden op http://poli.cs.vsb.cz/c/help/dir0.htm#LBL11 kunnen uitvoeren:
C++:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
| #include <dir.h> #include <stdio.h> #include <string.h> char *current_directory(char *path) { strcpy(path, "X:\\"); /* fill string with form of response: X:\ */ path[0] = 'A' + getdisk(); /* replace X with current drive letter */ getcurdir(0, path+3); /* fill rest of string with current directory */ return(path); } int main(void) { char curdir[MAXPATH]; current_directory(curdir); printf("The current directory is %s\n", curdir); return 0; } |
Hele tijd gegoogled en geGotterd, maar vind niet de goede topics over dir.h, dirent.h etc...
Error die ik krijg: can't open include file: 'dir.h'
Komt dit nu omdat bestand helemaal niet bij VC++ standaard zit en ik hem dus moet downloaden en in project map moet stoppen? Of is het een standaard header file van een niet-windows OS?