Click here to Skip to main content
15,895,667 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: atoi conversion query. Pin
«_Superman_»6-Oct-10 0:21
professional«_Superman_»6-Oct-10 0:21 
AnswerRe: atoi conversion query. PinPopular
Richard MacCutchan6-Oct-10 0:23
mveRichard MacCutchan6-Oct-10 0:23 
AnswerRe: atoi conversion query. Pin
Code-o-mat6-Oct-10 1:38
Code-o-mat6-Oct-10 1:38 
QuestionResource conflict on ON_UPDATE_COMMAND_UI Pin
yccheok5-Oct-10 22:52
yccheok5-Oct-10 22:52 
AnswerRe: Resource conflict on ON_UPDATE_COMMAND_UI Pin
«_Superman_»5-Oct-10 23:05
professional«_Superman_»5-Oct-10 23:05 
GeneralRe: Resource conflict on ON_UPDATE_COMMAND_UI Pin
yccheok5-Oct-10 23:13
yccheok5-Oct-10 23:13 
GeneralRe: Resource conflict on ON_UPDATE_COMMAND_UI Pin
«_Superman_»5-Oct-10 23:15
professional«_Superman_»5-Oct-10 23:15 
GeneralRe: Resource conflict on ON_UPDATE_COMMAND_UI Pin
yccheok5-Oct-10 23:36
yccheok5-Oct-10 23:36 
GeneralRe: Resource conflict on ON_UPDATE_COMMAND_UI Pin
Sauro Viti7-Oct-10 23:07
professionalSauro Viti7-Oct-10 23:07 
QuestionNeed to know how to make a custom control scroll nicely with a CView... Pin
Ben Aldhouse5-Oct-10 21:42
Ben Aldhouse5-Oct-10 21:42 
Questionsocket program is able to connect to the port which is still in TIME_WAIT [modified] Pin
Jayapal Chandran5-Oct-10 20:45
Jayapal Chandran5-Oct-10 20:45 
AnswerRe: socket program is able to connect to the port which is still in TIME_WAIT Pin
Moak5-Oct-10 23:25
Moak5-Oct-10 23:25 
GeneralRe: socket program is able to connect to the port which is still in TIME_WAIT Pin
Jayapal Chandran6-Oct-10 4:53
Jayapal Chandran6-Oct-10 4:53 
GeneralRe: socket program is able to connect to the port which is still in TIME_WAIT Pin
Moak6-Oct-10 6:39
Moak6-Oct-10 6:39 
GeneralRe: socket program is able to connect to the port which is still in TIME_WAIT Pin
Jayapal Chandran7-Oct-10 0:44
Jayapal Chandran7-Oct-10 0:44 
QuestionHooking TerminateProcess or ExitProcess Pin
NehaMishra286845-Oct-10 20:20
NehaMishra286845-Oct-10 20:20 
AnswerRe: Hooking TerminateProcess or ExitProcess Pin
«_Superman_»5-Oct-10 20:45
professional«_Superman_»5-Oct-10 20:45 
QuestionBasicExcel.Load --- crash!!! Pin
ssm19841195-Oct-10 20:11
ssm19841195-Oct-10 20:11 
AnswerRe: BasicExcel.Load --- crash!!! Pin
Richard MacCutchan5-Oct-10 21:26
mveRichard MacCutchan5-Oct-10 21:26 
AnswerRe: BasicExcel.Load --- crash!!! Pin
Sameerkumar Namdeo5-Oct-10 23:25
Sameerkumar Namdeo5-Oct-10 23:25 
Questiondate comparison Pin
ggoutam75-Oct-10 19:03
ggoutam75-Oct-10 19:03 
Hello,

I am trying to compare 2 dates and find out which one is greater. The second date is current date.
It is not working. Below is full program code :
<br />
#include <stdio.h><br />
#include <conio.h><br />
#include <time.h><br />
<br />
void CompareDates();<br />
<br />
void main()<br />
{<br />
	CompareDates();<br />
	getch();<br />
}<br />
<br />
<br />
void CompareDates() <br />
{<br />
	int year = 2010;<br />
	int month = 12;<br />
	int day = 31;<br />
<br />
	time_t rawtime1;<br />
	time(&rawtime1);<br />
	time_t rawtime2;<br />
	time(&rawtime2);<br />
<br />
	struct tm * timeinfo1;<br />
	timeinfo1 = localtime(&rawtime1);<br />
	struct tm * timeinfo2;<br />
	timeinfo2 = localtime(&rawtime2);<br />
<br />
	timeinfo1->tm_year = year - 1900;<br />
	timeinfo1->tm_mon = month - 1;<br />
	timeinfo1->tm_mday = day;<br />
	mktime (timeinfo1); //Not sure about this. When tested makes no difference with or without this line<br />
<br />
	char buffer1 [80];<br />
	strftime (buffer1,80,"timeinfo1 : %c.",timeinfo1);<br />
	puts (buffer1);<br />
<br />
	char buffer2 [80];<br />
	strftime (buffer2,80,"timeinfo2 : %c.",timeinfo2);<br />
	puts (buffer2);<br />
<br />
	if(timeinfo1 > timeinfo2) <br />
	{<br />
		puts("more");<br />
	}<br />
	else <br />
	{<br />
		puts("less");<br />
	}<br />
}<br />


Your guidance is very much appreciated.

Thanking you in advance,
Goutam
AnswerRe: date comparison Pin
Sameerkumar Namdeo5-Oct-10 19:17
Sameerkumar Namdeo5-Oct-10 19:17 
AnswerRe: date comparison Pin
«_Superman_»5-Oct-10 19:28
professional«_Superman_»5-Oct-10 19:28 
GeneralRe: date comparison [modified] Pin
ggoutam75-Oct-10 20:54
ggoutam75-Oct-10 20:54 
GeneralRe: date comparison Pin
David Crow6-Oct-10 3:24
David Crow6-Oct-10 3:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.