Link to home
Start Free TrialLog in
Avatar of -Mack-
-Mack-

asked on

Opening a file or folder in C++

Hey I have a quick question, how can I open a file and read the contents in c++, but what I really want to do is just ask windows to do it from a c++ program. Like make a call and have a folder open (like if you had just dbl clicked your "My Computer" folder on your desktop), or have your program have windows open up your word doc, in micr$oft word. Any help would be great, thanks-
-=Mack=-
ASKER CERTIFIED SOLUTION
Avatar of jhance
jhance

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of alexanderthegreat
alexanderthegreat

Maybe this is what you mean.


#include <stdlib.h>



void main()
{
     system("dir");
}
Avatar of -Mack-

ASKER

jhance that is what i was looking for thanks, I have another quick question though, when I compile in my command promt in java I can type in                     set path=%path%;c:\j2sdk1.4.0_01\bin   and in so it will know where my compiler is in that way I can use my windows command promt more like a linux machine. When I compile i just type in javac -classpath ... then file.java ,  when trying to do the same with the borland c++ compiler, it has trouble finding my libraries. In the question above forinstance it was unable to find the windows.h   can you help me out? thank,
-Mack-
I'm not familiar with Borland C++ but I suspect that it uses either an ENV variable or a command line option to locate the INCLUDE file directory.  Check the docs....