Click here to Skip to main content
15,900,461 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to design a decoder in C++? Pin
Stuart Dootson3-Jun-09 21:33
professionalStuart Dootson3-Jun-09 21:33 
GeneralRe: How to design a decoder in C++? Pin
kapardhi4-Jun-09 3:27
kapardhi4-Jun-09 3:27 
GeneralRe: How to design a decoder in C++? Pin
Stuart Dootson4-Jun-09 3:31
professionalStuart Dootson4-Jun-09 3:31 
GeneralRe: How to design a decoder in C++? [modified] Pin
kapardhi4-Jun-09 3:49
kapardhi4-Jun-09 3:49 
GeneralRe: How to design a decoder in C++? Pin
Stuart Dootson4-Jun-09 3:59
professionalStuart Dootson4-Jun-09 3:59 
GeneralRe: How to design a decoder in C++? Pin
kapardhi4-Jun-09 21:03
kapardhi4-Jun-09 21:03 
GeneralRe: How to design a decoder in C++? Pin
Stuart Dootson4-Jun-09 21:45
professionalStuart Dootson4-Jun-09 21:45 
GeneralRe: How to design a decoder in C++? Pin
kapardhi5-Jun-09 0:05
kapardhi5-Jun-09 0:05 
GeneralRe: How to design a decoder in C++? Pin
Stuart Dootson5-Jun-09 0:23
professionalStuart Dootson5-Jun-09 0:23 
QuestionUrgent! Smart house with SMS project Pin
ericyeoh2-Jun-09 16:33
ericyeoh2-Jun-09 16:33 
QuestionRe: Urgent! Smart house with SMS project Pin
CPallini2-Jun-09 21:39
mveCPallini2-Jun-09 21:39 
QuestionMFC Process Pin
duongcntt4b2-Jun-09 15:39
duongcntt4b2-Jun-09 15:39 
QuestionRe: MFC Process Pin
David Crow2-Jun-09 16:52
David Crow2-Jun-09 16:52 
AnswerRe: MFC Process Pin
Stephen Hewitt2-Jun-09 20:34
Stephen Hewitt2-Jun-09 20:34 
AnswerRe: MFC Process Pin
duongcntt4b2-Jun-09 21:26
duongcntt4b2-Jun-09 21:26 
GeneralRe: MFC Process Pin
David Crow3-Jun-09 2:34
David Crow3-Jun-09 2:34 
QuestionC and C++ malloc and free Pin
jobin0070072-Jun-09 11:59
jobin0070072-Jun-09 11:59 
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

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.