Click here to Skip to main content
15,881,882 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: C and C++ malloc and free Pin
John R. Shaw2-Jun-09 13:40
John R. Shaw2-Jun-09 13:40 
QuestionHelp compiling a library program in 'C' [modified] Pin
warpbro2-Jun-09 11:11
warpbro2-Jun-09 11:11 
QuestionRe: Help compiling a library program in 'C' Pin
David Crow2-Jun-09 16:54
David Crow2-Jun-09 16:54 
AnswerRe: Help compiling a library program in 'C' Pin
norish2-Jun-09 17:51
norish2-Jun-09 17:51 
GeneralRe: Help compiling a library program in 'C' [modified] Pin
warpbro3-Jun-09 4:13
warpbro3-Jun-09 4:13 
GeneralRe: Help compiling a library program in 'C' Pin
warpbro4-Jun-09 22:22
warpbro4-Jun-09 22:22 
QuestionHow to trace/log 3rd Party library API calls made by an application through WinDbg [modified] Pin
ComplexLifeForm2-Jun-09 8:51
ComplexLifeForm2-Jun-09 8:51 
Questioncalculte time between two dates !!! Pin
pillsforkills2-Jun-09 6:23
pillsforkills2-Jun-09 6:23 
hey everybody,,

below is the code which i have written which gives the time diff for two inputs,,,,
but now i want to calculate time diff when input date is specified

eg: input 1 : 2/12/09 9:30:00
input 1 : 2/14/09 9:30:00

how do i do this ???
------------------------------------code-----------------------------------------
#include <iostream>
using namespace std;

struct timeType {
int hours;
int mins;
int secs;
};
void main(void)
{

struct timeType start, stop, diff;

cout << "\n Enter the start time (hh:mm:ss): ";
cin >> start.hours; cin.ignore(1,':'); cin >> start.mins; cin.ignore(1,':'); cin >> start.secs;
cout << "\n Enter the stop time (hh:mm:ss): ";
cin >> stop.hours; cin.ignore(1,':'); cin >> stop.mins; cin.ignore(1,':'); cin >> stop.secs;
int intStartSeconds, intStopSeconds, intDiffSeconds = 0;

intStartSeconds = start.hours * 3600 + start.mins * 60 + start.secs ;
intStopSeconds = stop.hours * 3600 + stop.mins * 60 + stop.secs;
cout << "\n start = " << intStartSeconds << " seconds, stop = " << intStopSeconds << " seconds";

intDiffSeconds = intStopSeconds - intStartSeconds;


cout << "\n difference (in seconds) = " << intDiffSeconds;

diff.hours = intDiffSeconds / 3600;
intDiffSeconds = intDiffSeconds - (diff.hours * 3600);
diff.mins = intDiffSeconds / 60;
intDiffSeconds = intDiffSeconds - (diff.mins * 60);
diff.secs = intDiffSeconds;
cout << "\n difference = " << diff.hours << ":" << diff.mins << ":" << diff.secs;

cout << "\n\n";
}

-------------------------------------code------------------------------------------

thx you fer ur help
QuestionRe: calculte time between two dates !!! Pin
CPallini2-Jun-09 6:36
mveCPallini2-Jun-09 6:36 
QuestionRe: calculte time between two dates !!! Pin
David Crow2-Jun-09 7:48
David Crow2-Jun-09 7:48 
Questionsha256 test vector Pin
Bill Salibrici2-Jun-09 5:52
Bill Salibrici2-Jun-09 5:52 
QuestionControl CStatic, Height of FONT Pin
durban22-Jun-09 4:28
durban22-Jun-09 4:28 
AnswerRe: Control CStatic, Height of FONT Pin
Hamid_RT2-Jun-09 5:17
Hamid_RT2-Jun-09 5:17 
AnswerRe: Control CStatic, Height of FONT Pin
nyeboy2-Jun-09 6:55
nyeboy2-Jun-09 6:55 
GeneralRe: Control CStatic, Height of FONT Pin
ForNow1-Jul-15 8:08
ForNow1-Jul-15 8:08 
Questionfunction Pin
durban22-Jun-09 4:07
durban22-Jun-09 4:07 
AnswerRe: function Pin
Chris Losinger2-Jun-09 4:10
professionalChris Losinger2-Jun-09 4:10 
NewsRe: function Pin
CPallini2-Jun-09 6:29
mveCPallini2-Jun-09 6:29 
QuestionUrgent please from Ethiopia! Pin
mekonnenn2-Jun-09 3:51
mekonnenn2-Jun-09 3:51 
AnswerRe: Urgent please from Ethiopia! Pin
CPallini2-Jun-09 4:00
mveCPallini2-Jun-09 4:00 
AnswerRe: Urgent please from Ethiopia! Pin
David Crow2-Jun-09 4:22
David Crow2-Jun-09 4:22 
JokeRe: Urgent please from Ethiopia! Pin
Hamid_RT2-Jun-09 5:20
Hamid_RT2-Jun-09 5:20 
GeneralRe: Urgent please from Ethiopia! Pin
Luc Pattyn2-Jun-09 6:15
sitebuilderLuc Pattyn2-Jun-09 6:15 
AnswerRe: Urgent please from Ethiopia! Pin
nyeboy2-Jun-09 7:24
nyeboy2-Jun-09 7:24 
Questionhow to get command line arguments in MFC Pin
hemlat2-Jun-09 3:41
hemlat2-Jun-09 3:41 

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.