Skip to main content
gamedev.net
🔒 Locked

create folder and create file

Started by skydogwong Nov 3, 2004 at 9:40 PM 2 replies 800+ views
Original Post
skydogwong
skydogwong
can anyone please help me, cos i struggle to create folder(directory) and create file with the name i want in c++ (i am using Visual c++). i am not a c++ expert and i don't know MFC. can anyone show me the codes? and with examples? Thanks a lot first and i am waiting for reply.
Oluseyi
Oluseyi
It's platform specific, really. You can create a file by opening one for writing in C/C++, and you can delete it by using the remove function, but there's a lot of inelegance with that approach.

For Windows, use CreateFile and CreateDirectory.
skydogwong
skydogwong
Thanks. i know these two createDirectory and create file but how to use them? can you please give me an example? Thanks a lot first.
the other problem is how to assign them the name that i want, because i need to change the names every loop.
skydogwong
skydogwong
now i know how to use them. Thanks for your help! (^O^)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.