I need the program to create a folder with the current date installed on the PC. Here is the code that I wrote and the error message that results from the execution of the code.
#include "time.h" #include <fstream> using namespace std; char buffer[80]; char* filename ( ) { time_t timess; struct tm * timeinfo; time ( ×s ); char *buff2 = buffer; timeinfo = localtime ( ×s ); strftime ( buff2, 80, "%y%m%d%", timeinfo ); strcat ( buff2, ".txt" ); return ( buff2 ); } Error 1 error C4996: 'localtime': This function or variable may be unsafe. Consider using localtime_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. f: \ documents \ visual studio 2013 \ projects \ main \ time file creator \ main.cpp 12 1 time file creator
Tell me what am I doing wrong? And if possible, describe how to make that from another folder, all the files that are in it, moved to this folder automatically? (and only 1 file type was left)
Write in detail, because I'm still new to this.
c++. - αλεχολυτ