Click here to Skip to main content
15,902,492 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalhash_set and std::string Pin
Martin AntonioA21-Mar-03 22:41
sussMartin AntonioA21-Mar-03 22:41 
GeneralRe: hash_set and std::string Pin
valikac22-Mar-03 6:52
valikac22-Mar-03 6:52 
Generalplz..help me...ㅠㅠ;; from mad combo Pin
tvhead8021-Mar-03 22:25
tvhead8021-Mar-03 22:25 
GeneralAbout #pragma Pin
gumber21-Mar-03 19:35
gumber21-Mar-03 19:35 
GeneralRe: About #pragma Pin
Michael Dunn21-Mar-03 20:27
sitebuilderMichael Dunn21-Mar-03 20:27 
GeneralStream Manipulators Pin
Makover21-Mar-03 19:21
Makover21-Mar-03 19:21 
QuestionIn-place edit of CListCtrl columns > 0 ? Pin
Bonnie221-Mar-03 16:40
Bonnie221-Mar-03 16:40 
GeneralStrange class statement... Pin
Aidman21-Mar-03 14:49
Aidman21-Mar-03 14:49 
While I was looking at an example of class operations I saw something I never seen before. Where the constructor for class Position is declared there is a “:x(xx),y(yy)” statement and I can’t understand what it is doing. I seems like it is using float x and y as functions, and this even before the “{}”. Please explain this statement, what it does, how it does it, what else strange statements like this you can do and if there is any where I can read more about this?

#include<iostream.h><br />
<br />
class Position {<br />
	float x,y;<br />
public:<br />
	Position(float xx, float yy=0):x(xx),y(yy) {}<br />
	Position operator + (const Position& e) const;<br />
	Position operator - (const Position& e) const;<br />
	<br />
	void Display(void)<br />
	{ cout << "(" << x << ", " << y << ")" << endl; }<br />
	void Input(void)<br />
	{ cout << "enter x och y:"; cin >> y;; }<br />
};<br />
<br />
Position Position::operator + (const Position& e) const<br />
{<br />
	Position res = *this;<br />
	res.x += e.x;<br />
	res.y += e.y;<br />
	return (res);<br />
}<br />
<br />
Position Position::operator - (const Position& e) const<br />
{<br />
	Position res = *this;<br />
	res.x -= e.x;<br />
	res.y -= e.y;<br />
	return (res);<br />
}


Aidman » over and out
GeneralRe: Strange class statement... Pin
Chris Losinger21-Mar-03 14:51
professionalChris Losinger21-Mar-03 14:51 
QuestionHow disable sound in control ?? Pin
selecta21-Mar-03 14:46
selecta21-Mar-03 14:46 
GeneralBOOL vs. bool Pin
Anton A. Loukine21-Mar-03 14:28
Anton A. Loukine21-Mar-03 14:28 
GeneralRe: BOOL vs. bool Pin
Chris Losinger21-Mar-03 14:32
professionalChris Losinger21-Mar-03 14:32 
GeneralRe: BOOL vs. bool Pin
Anton A. Loukine21-Mar-03 14:45
Anton A. Loukine21-Mar-03 14:45 
GeneralRe: BOOL vs. bool Pin
Chris Losinger21-Mar-03 14:49
professionalChris Losinger21-Mar-03 14:49 
GeneralRe: BOOL vs. bool Pin
Michael Dunn21-Mar-03 15:41
sitebuilderMichael Dunn21-Mar-03 15:41 
GeneralString datatype mathematical addition Pin
Grant Cobb21-Mar-03 13:28
Grant Cobb21-Mar-03 13:28 
GeneralWindows 98 abnormal program termination Pin
Ambit21-Mar-03 12:34
Ambit21-Mar-03 12:34 
GeneralRe: Windows 98 abnormal program termination Pin
Ravi Bhavnani21-Mar-03 13:05
professionalRavi Bhavnani21-Mar-03 13:05 
GeneralRe: Windows 98 abnormal program termination Pin
Ambit22-Mar-03 7:58
Ambit22-Mar-03 7:58 
GeneralRe: Windows 98 abnormal program termination Pin
Ravi Bhavnani22-Mar-03 9:32
professionalRavi Bhavnani22-Mar-03 9:32 
GeneralRe: Windows 98 abnormal program termination Pin
Ambit22-Mar-03 13:53
Ambit22-Mar-03 13:53 
Generalmemcpy vs. memmove Pin
pba_21-Mar-03 10:24
pba_21-Mar-03 10:24 
GeneralRe: memcpy vs. memmove Pin
Chris Losinger21-Mar-03 10:48
professionalChris Losinger21-Mar-03 10:48 
GeneralRe: memcpy vs. memmove Pin
pba_21-Mar-03 10:58
pba_21-Mar-03 10:58 
GeneralRe: memcpy vs. memmove Pin
Chris Losinger21-Mar-03 11:59
professionalChris Losinger21-Mar-03 11:59 

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.