So i am trying to make a program that takes the date from windows (this is not where i have the problem). My problem is i want to use that date and create a txt file for each day. For example it would create a file named... 8_4_2010 for today and then 8_5_2010 for tomorrow.
Here is the code i have...
//this successfully gets the date i have check it
char dateStr [9];
_strdate( dateStr);
//this sets the name for the file
ofstream out(_strdate.c_str());
out.open(_strdate.c_str(),ios::out |ios::app);
out.flush();
out.close();
I get the error message...
request for member `c_str' in `_strdate', which is of non-class type `char*()(char*)'
i used the c_str because i had the error message...
no matching function for call to `std::basic_ofstream<char, std::char_traits<char> >::basic_ofstream(char*(&)(char*))'
and when i reseached that error message the c_str was supposed the solve the problem. there probably is something wrong with my approach to what i am trying to accomplish so i was just looking for some input.
oh and this is my first time posting so i hope i followed all of the rules of posting if not just tell me so i can do it differently next time.