Click here to Skip to main content
15,914,160 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: how to share one dll with multiple instance Pin
DimpleSurana19-Feb-04 20:52
DimpleSurana19-Feb-04 20:52 
GeneralRe: how to share one dll with multiple instance Pin
Rajesh match19-Feb-04 21:23
Rajesh match19-Feb-04 21:23 
GeneralRe: how to share one dll with multiple instance Pin
DimpleSurana19-Feb-04 23:29
DimpleSurana19-Feb-04 23:29 
GeneralRe: how to share one dll with multiple instance Pin
Mike Beckerleg20-Feb-04 1:30
Mike Beckerleg20-Feb-04 1:30 
GeneralMFC and Messages handling Pin
Melflex19-Feb-04 16:58
Melflex19-Feb-04 16:58 
Questionwhere to get divx 5.02 encode? Pin
hxr60119-Feb-04 16:42
hxr60119-Feb-04 16:42 
AnswerRe: where to get divx 5.02 encode? Pin
Christian Graus19-Feb-04 17:08
protectorChristian Graus19-Feb-04 17:08 
Generala class function Pin
Anonymous19-Feb-04 16:02
Anonymous19-Feb-04 16:02 
I have this program, and I need to find the difference between the start time and end time. My code:

<br />
#include <iostream.h><br />
#include <iomanip.h><br />
<br />
class StopWatch<br />
{<br />
public:<br />
	StopWatch(float hour, float minute, float second);<br />
	StopWatch();<br />
	void difference(StopWatch start_time, StopWatch end_time);<br />
	int get_hour();<br />
	int get_minute();<br />
	int get_second();<br />
	int reg_time();<br />
	int mil_time();<br />
private:<br />
	int hour, minute, second;<br />
	<br />
};<br />
<br />
void main()<br />
{<br />
	int start_time, end_time;<br />
	char chr;<br />
	int difference;<br />
	cout << "This program is a stop watch program.  It will store time in hours, minutes, and seconds" << endl;<br />
	do<br />
	{<br />
		StopWatch start_time, end_time, mil_time, reg_time;<br />
		cout << "Enter Start Time" << endl;<br />
		start_time.get_hour();<br />
		start_time.get_minute();<br />
		start_time.get_second();<br />
<br />
		cout << "Enter End Time" << endl;<br />
		end_time.get_hour();<br />
		end_time.get_minute();<br />
		end_time.get_second();<br />
<br />
		cout << "In Military Time" << endl;<br />
		cout <<	" Start Time Entered: ";<br />
		start_time.mil_time();<br />
		cout << " End Time Entered: ";<br />
		end_time.mil_time();<br />
<br />
		cout << "In Regular Time" << endl;<br />
		cout << " Start Time: ";<br />
		start_time.reg_time();<br />
		cout << " End Time: ";<br />
		end_time.reg_time();<br />
<br />
		difference(start_time, end_time);<br />
		cout << "Do you wish to enter another time(Y/N)?" << endl;<br />
		cin >> chr;<br />
		if(chr != 'N' && chr != 'n' && chr != 'Y' && chr != 'y')<br />
		{<br />
			cout << "Enter Y or N" << endl;<br />
		}<br />
	}while (chr == 'Y' || chr == 'y');<br />
	<br />
		<br />
}	<br />
<br />
StopWatch::StopWatch(float hours, float minutes, float seconds)<br />
{<br />
	hour = hours;<br />
	minute = minutes;<br />
	second = seconds;<br />
}<br />
<br />
StopWatch::StopWatch() : hour(0), minute(0), second(0)<br />
{<br />
	//empty<br />
}<br />
<br />
int StopWatch::get_hour()<br />
{<br />
	cout << " Hour: ";<br />
	cin >> hour;<br />
	return hour;<br />
}<br />
<br />
int StopWatch::get_minute()<br />
{<br />
	cout << " Minute: ";<br />
	cin >> minute;<br />
	return minute;<br />
}<br />
<br />
int StopWatch::get_second()<br />
{<br />
	cout << " Second: ";<br />
	cin >> second;<br />
	return second;<br />
}<br />
<br />
int StopWatch::reg_time()<br />
{<br />
<br />
	cout << setfill('0') << setw (2) << hour << ":" << setw (2) << minute << ":" << setw(2) << second;<br />
	if(hour < 12)<br />
		cout << " AM";<br />
		else<br />
			cout << " PM";<br />
	cout << endl;<br />
	<br />
	return 0;<br />
}<br />
<br />
int StopWatch::mil_time()<br />
{<br />
	cout << setfill('0') << setw (2) << hour << ":" << setw (2) << minute << ":" << setw(2) << second << endl;<br />
	return 0;<br />
}<br />
<br />
void difference(StopWatch start_time, StopWatch end_time)<br />
{<br />
	cout << "difference = "  << start_time.get_hour() - end_time.get_hour() << " hours, " << start_time.get_minute() - end_time.get_minute() << " minutes, " << start_time.get_second() - end_time.get_second() << " seconds" << endl;<br />
	<br />
}<br />


It is the last function I need help with... well calling it anyways. I'm just not sure how to do it.
GeneralRe: a class function Pin
Christian Graus19-Feb-04 17:11
protectorChristian Graus19-Feb-04 17:11 
GeneralRe: a class function Pin
warlu19-Feb-04 20:48
warlu19-Feb-04 20:48 
General? about compiler Pin
Snyp19-Feb-04 15:24
Snyp19-Feb-04 15:24 
GeneralRe: ? about compiler Pin
Maxwell Chen19-Feb-04 21:07
Maxwell Chen19-Feb-04 21:07 
GeneralData display question Pin
rmnowick19-Feb-04 11:43
rmnowick19-Feb-04 11:43 
GeneralRe: Data display question Pin
l a u r e n19-Feb-04 15:43
l a u r e n19-Feb-04 15:43 
GeneralRe: Data display question Pin
eggie515-May-04 10:54
eggie515-May-04 10:54 
GeneralI need some help!!! Pin
rodneyk119-Feb-04 11:14
rodneyk119-Feb-04 11:14 
GeneralRe: I need some help!!! Pin
Christian Graus19-Feb-04 11:37
protectorChristian Graus19-Feb-04 11:37 
GeneralRe: I need some help!!! Pin
l a u r e n19-Feb-04 15:44
l a u r e n19-Feb-04 15:44 
QuestionHow to tell if display is 640x480? Pin
mcgahanfl19-Feb-04 10:19
mcgahanfl19-Feb-04 10:19 
AnswerRe: How to tell if display is 640x480? Pin
Christian Graus19-Feb-04 10:36
protectorChristian Graus19-Feb-04 10:36 
GeneralIt just blows up !!! Pin
Christian Graus19-Feb-04 9:31
protectorChristian Graus19-Feb-04 9:31 
GeneralRe: It just blows up !!! Pin
Jörgen Sigvardsson19-Feb-04 12:03
Jörgen Sigvardsson19-Feb-04 12:03 
GeneralRe: It just blows up !!! Pin
Christian Graus19-Feb-04 12:40
protectorChristian Graus19-Feb-04 12:40 
GeneralRe: It just blows up !!! Pin
Jörgen Sigvardsson19-Feb-04 12:48
Jörgen Sigvardsson19-Feb-04 12:48 
GeneralSetNamedSecurityInfo Pin
jamm_8219-Feb-04 9:26
jamm_8219-Feb-04 9: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.