RE: [Dev-C++] Reading the directory on C:
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: PhrostByte <Phr...@so...> - 2002-09-10 12:01:04
|
Do you mean, like this?
Untested but should work.. No error checking too ;)
#include <dirent.h>
#include <stdio.h>
int main(void) {
DIR *directory;
struct dirent *entries;
=09
directory=3Dopendir("./")
printf("Directory Contents:\n\n");
while((entries=3Dreaddir(directory))) puts(entries->d_name);
closedir(directory);
return 0;
}
-----Original Message-----
From: dev...@li...
[mailto:dev...@li...] On Behalf Of
Ext...@no...
Sent: Monday, September 09, 2002 11:20 PM
To: dev...@li...
Subject: [Dev-C++] Reading the directory on C:
Do any of you guys have a small c++ program that reads the directory?
BR Kurt
> -----Original Message-----
> From: ext dev...@li...
> [mailto:dev...@li...]
> Sent: 09 September, 2002 22:03
> To: dev...@li...
> Subject: Dev-cpp-users digest, Vol 1 #964 - 2 msgs
>=20
>=20
> Send Dev-cpp-users mailing list submissions to
> dev...@li...
>=20
> To subscribe or unsubscribe via the World Wide Web, visit
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
> or, via email, send a message with subject or body 'help' to
> dev...@li...
>=20
> You can reach the person managing the list at
> dev...@li...
>=20
> When replying, please edit your Subject line so it is more specific=20
> than "Re: Contents of Dev-cpp-users digest..."
>=20
>=20
> Today's Topics:
>=20
> 1. Re: iostream "without" cout (h.r...@gm...)
> 2. Re: iostream "without" cout (Carlos
> =3D?iso-8859-1?Q?Garc=3DEDa?=3D del Monte)
>=20
> --__--__--
>=20
> Message: 1
> Date: Mon, 9 Sep 2002 19:02:54 +0200 (MEST)
> From: h.r...@gm...
> To: Dev...@li...
> Subject: Re: [Dev-C++] iostream "without" cout
>=20
> > I instaled Dev 4.9.5.0 executable with MinGW 2.0.0-2, and
> in a project
> > with seven files, all of them include <iostream>, in one of
> them it says
> > cout and endl undeclared, and iostream is included (?).
> Directories are
> > well inserted. If I change <iostream> with <iostream.h>
> then it works (I
> > add all include directories, the backward too).
> > What can cause that?
> >=20
>=20
> have you declared using std:cout or using namespace std ?. cout with=20
> <iostream> is in namespace std and cout with <iostream.h> is in
> global namespace.
>=20
> BTW: there is a mingw 2.2.2-3.
>=20
> greetings
> Horst
>=20
> --
> Horst R=F6=DFner
> Postf. 1802
> 52205 Stolberg
>=20
> ICQ ID #74808448
> h.r...@gm...
> h.g...@t-...
>=20
> GMX - Die Kommunikationsplattform im Internet. http://www.gmx.net
>=20
>=20
>=20
> --__--__--
>=20
> Message: 2
> Date: Mon, 09 Sep 2002 19:06:13 +0200
> From: Carlos =3D?iso-8859-1?Q?Garc=3DEDa?=3D del Monte <cg...@wo...>
> To: dev-cpp-users-list <dev...@li...>
> Subject: [Dev-C++] Re: iostream "without" cout
>=20
> Discovered, I forgot using namespace std in that file;
>=20
> Uhm!Grrrr....
>=20
> Carlos =3D3D?iso-8859-1?Q?Garc=3D3DEDa?=3D3D del Monte escribi=3DF3:
>=20
> > I instaled Dev 4.9.5.0 executable with MinGW 2.0.0-2, and
> in a project
> > with seven files, all of them include <iostream>, in one of
> them it say=3D
> s
> > cout and endl undeclared, and iostream is included (?).
> Directories are
> > well inserted. If I change <iostream> with <iostream.h>
> then it works (=3D
> I
> > add all include directories, the backward too).
> > What can cause that?
>=20
>=20
>=20
>=20
> --__--__--
>=20
> _______________________________________________
> Dev-cpp-users mailing list Dev...@li...
> TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>=20
>=20
> End of Dev-cpp-users Digest
>=20
-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old cell
phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=3Durceforge1&refcode1=3D3390
_______________________________________________
Dev-cpp-users mailing list
Dev...@li...
TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|