Click here to Skip to main content
14,737,867 members
Home » Discussions » C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: I can't compile and put it as a variable and matrix Pin
jeron15-Nov-20 15:21
Memberjeron15-Nov-20 15:21 
GeneralRe: I can't compile and put it as a variable and matrix Pin
jsc4226-Nov-20 6:55
professionaljsc4226-Nov-20 6:55 
GeneralRe: I can't compile and put it as a variable and matrix Pin
David Crow9-Nov-20 3:52
MemberDavid Crow9-Nov-20 3:52 
GeneralRe: I can't compile and put it as a variable and matrix Pin
jeron19-Nov-20 5:05
Memberjeron19-Nov-20 5:05 
Questioni need your help Pin
Member 149820522-Nov-20 12:09
MemberMember 149820522-Nov-20 12:09 
AnswerRe: i need your help Pin
Victor Nijegorodov2-Nov-20 21:36
MemberVictor Nijegorodov2-Nov-20 21:36 
QuestionDifference between current system time and time from user input in c Pin
Member 1497910831-Oct-20 7:00
MemberMember 1497910831-Oct-20 7:00 
AnswerRe: Difference between current system time and time from user input in c Pin
Mircea Neacsu31-Oct-20 7:59
mvaMircea Neacsu31-Oct-20 7:59 
You could calculate the number of seconds from midnight for current time and user given time. Subtract the two and convert back to hours, minutes seconds:
time_t now;
time (&now); //missed this
struct tm *systime = localtime(&now);
struct tm user_time = {56, 34, 12}; // user = 12:34:56
int sys_sec = systime->tm_hour*3600 + systime->tm_min*60 + stystime->tm_sec;
int user_sec = user_time.tm_hour*3600 + user_time.tm_min*60 + user_time.tm_sec;
int diff = sys_sec - user_sec;

Of course you have to figure out what to do when time wraps around at midnight but that's your problem Smile | :) . I'm just showing how you can shoot yourself in the foot
Mircea


modified 31-Oct-20 14:15pm.

GeneralRe: Difference between current system time and time from user input in c Pin
Richard Andrew x6431-Oct-20 9:03
professionalRichard Andrew x6431-Oct-20 9:03 
GeneralRe: Difference between current system time and time from user input in c Pin
Mircea Neacsu31-Oct-20 9:14
mvaMircea Neacsu31-Oct-20 9:14 
GeneralRe: Difference between current system time and time from user input in c Pin
Richard MacCutchan31-Oct-20 10:38
mveRichard MacCutchan31-Oct-20 10:38 
GeneralRe: Difference between current system time and time from user input in c Pin
Richard Andrew x6431-Oct-20 11:28
professionalRichard Andrew x6431-Oct-20 11:28 
GeneralRe: Difference between current system time and time from user input in c Pin
Richard MacCutchan31-Oct-20 22:22
mveRichard MacCutchan31-Oct-20 22:22 
GeneralRe: Difference between current system time and time from user input in c Pin
Richard Andrew x641-Nov-20 10:58
professionalRichard Andrew x641-Nov-20 10:58 
GeneralRe: Difference between current system time and time from user input in c Pin
Richard MacCutchan1-Nov-20 22:58
mveRichard MacCutchan1-Nov-20 22:58 
AnswerRe: Difference between current system time and time from user input in c Pin
Daniel Pfeffer31-Oct-20 12:24
professionalDaniel Pfeffer31-Oct-20 12:24 
QuestionSearching and displaying a record in Array of Structure in c Pin
Member 1497910829-Oct-20 17:45
MemberMember 1497910829-Oct-20 17:45 
AnswerRe: Searching and displaying a record in Array of Structure in c Pin
CPallini29-Oct-20 22:27
mveCPallini29-Oct-20 22:27 
QuestionHow to convert my MDI Application to open each window as a separate instance of the application Pin
manoharbalu23-Oct-20 1:09
Membermanoharbalu23-Oct-20 1:09 
AnswerRe: How to convert my MDI Application to open each window as a separate instance of the application Pin
trønderen23-Oct-20 1:34
Membertrønderen23-Oct-20 1:34 
GeneralRe: How to convert my MDI Application to open each window as a separate instance of the application Pin
manoharbalu23-Oct-20 1:49
Membermanoharbalu23-Oct-20 1:49 
GeneralRe: How to convert my MDI Application to open each window as a separate instance of the application Pin
trønderen23-Oct-20 9:04
Membertrønderen23-Oct-20 9:04 
GeneralRe: How to convert my MDI Application to open each window as a separate instance of the application Pin
Victor Nijegorodov23-Oct-20 9:35
MemberVictor Nijegorodov23-Oct-20 9:35 
GeneralRe: How to convert my MDI Application to open each window as a separate instance of the application Pin
trønderen23-Oct-20 10:32
Membertrønderen23-Oct-20 10:32 
GeneralRe: How to convert my MDI Application to open each window as a separate instance of the application Pin
Victor Nijegorodov23-Oct-20 11:26
MemberVictor Nijegorodov23-Oct-20 11:26 

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.