cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
create a file with current system date
create a file with current system date
Nov 1, 2015 at 2:27pm UTC
Shashank Setty
(21)
hello!
can someone provide me the code to create a file with the system date as the name of the file example "1-11-2015.txt"
also how do i write data into the created file?
Nov 1, 2015 at 4:28pm UTC
ShiftLeft
(73)
There is an example @
http://www.cplusplus.com/reference/ctime/localtime/
and all you have to do is change line 12 to use sprintf. Then you can incorporate parts of
http://www.cplusplus.com/reference/fstream/ofstream/open/
changing line 9 to whatever it is you need to write to the file.
Topic archived. No new replies allowed.