Segmentation fault (cd) but only inside a class.
Go to solution
Solved by fizzlesticks,
19 minutes ago, ¨TrisT¨ said:Tell me if you have a better way to do it or I'm missing something very obvious.
And thank you.
You can use a char[] instead of char* to avoid the new and delete.
char buffer[31];
time_t now = time(0);
tm* timeinfo = gmtime(&now);
strftime(buffer, sizeof(buffer), "%a, %d %b %Y %X UTC", timeinfo);
return std::string(buffer);
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now