Archived

This topic is now archived and is closed to further replies.

johnnyBravo

What api can i use to open files for the win32 application enviroment ?

Recommended Posts

What api can i use to open files for the win32 application enviroment. Also i want a read function to read the whole line, so it doesn''t have to be specified unlike the stdio.h fgets one. Thanks

Share this post


Link to post
Share on other sites
You don''t need and API
You need the standard c++ fstream object, look up fstream. Also the WIN API itself has its own classes for files. Just look up file I/O in the msdn.
,
Brekehan

Share this post


Link to post
Share on other sites
Depending on your programming language etc. you can use CreateFile which is the Win32 API function for opening and creating files.

As for reading a line, simply read a character at a time until you get a LF character. If you are using streams or MFC then there are functions to do it for you but you haven''t said, so...



"Absorb what is useful, reject what is useless, and add what is specifically your own." - Lee Jun Fan

Share this post


Link to post
Share on other sites