1
I have the following code that takes the instant date from the computer.
#include <Windows.h>
#include <stdio.h>
#include <time.h>
void main () {
time_t t = time(NULL);
struct tm tm = *localtime(&t);
printf("Agora: %d/%d/%d", tm.tm_mday, tm.tm_mon+1, tm.tm_year+1900);
}
I need to save the date provided in a variable and I suppose, from the statement of my exercise, that it should be in the dd/mm/yyyy format, because there is a later need to search through the date.
What would be the easiest method to add the bars? Scan the vector with the date and in each position go putting the bar (that’s what I thought), or there is some more efficient solution?
There is some doubt in the statement about the date being in the format above, but I don’t want to take the risk and try for this format. The survey I referred to is the user informing two dates (start and end) and search all the records made on this date.
Any questions, just ask.
Thanks for the help! I think it will work perfectly as I need.
– João Iora