hi all
have anyone any idea how can i make my program read 3 or 4 files ,in a folder.
i mean my input isn't only one file, it's a folder.
can the C++ do that?

C++ doesn't know what a folder is. That kind of operation is dependent on the operating system, and the solution will use a system specific function or class of functions. So, what compiler and OS are you using?

yeah, its just like reading any other files. Just instead of the file name, but the path to the file. If your using windows you need two backslashes.

thanks alot for helping.
1. i'm using vc++ 6 and windows 2000
2.
u mean i'll wirte the whole path of folder and at the end i'll put //
ex.
D:\projects\\inputfolder
or D:\projects\inputfolder\\

I mean lets say you have three text files in one folder.

the path for them would be:

c:\\<whatever>\\yourfolder\\file1
c:\\<whatever>\\yourfolder\\file2
c:\\<whatever>\\yourfolder\\file3

He probably wants to be given a folder and open the files in that folder. Your solution assumes that he already knows the names of the files in the folder and the number of files is a constant.

and now what is new!!
i used to write it :
C:\folder1\folder2\file1.txt and it works.
now i need to give only the path for the folder and the program reads all the files in this folder
ex:
c:\folder1\folder2

and the c++ program reads all the files in this folder

yes , you are right.
that's what i need .
to open a folder not a file

yes i need to read all the files in this folder.
assuming that i'll open them before the program runs.,has the c++ this porperty?

This question has already been answered. Start a new discussion instead.