Click here to Skip to main content
15,887,596 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Question[Message Deleted] Pin
Purish Dwivedi25-Mar-09 19:21
Purish Dwivedi25-Mar-09 19:21 
AnswerRe: Detecting installed language pack through installshield for MFC application Pin
Cedric Moonen25-Mar-09 21:18
Cedric Moonen25-Mar-09 21:18 
General[Message Deleted] Pin
Purish Dwivedi25-Mar-09 23:28
Purish Dwivedi25-Mar-09 23:28 
GeneralRe: Detecting installed language pack through installshield for MFC application Pin
Cedric Moonen25-Mar-09 23:33
Cedric Moonen25-Mar-09 23:33 
General[Message Deleted] Pin
Purish Dwivedi26-Mar-09 0:33
Purish Dwivedi26-Mar-09 0:33 
GeneralRe: Detecting installed language pack through installshield for MFC application Pin
Cedric Moonen26-Mar-09 0:36
Cedric Moonen26-Mar-09 0:36 
QuestionHow to write a capture video data to .avi or .wmv file Pin
tns_ranjith25-Mar-09 19:11
tns_ranjith25-Mar-09 19:11 
QuestionProblem with return value of private variable within class Pin
Michael Randolph25-Mar-09 18:04
Michael Randolph25-Mar-09 18:04 
I am compiling with g++ 4.2.4 on Ubuntu Hardy. I am trying to creating a public function to return a value of a private variable within the class. The output I am getting is not correct. What did I miss here?
#include <iostream>

using namespace std;

class Point
{
public:
	// constructors
	Point(float f_x = 1.0, float f_y = 1.0, float f_z = 1.0);
	
	// destructors (Only necessary for new dynamic memory created)
	~Point();

	float getX();

private:
	float x, y, z;

protected:

};

// define constructor with args
Point::Point(float f_x, float f_y, float f_z)
{
	cout << "We're in the constructor with arguments " << (int)this /*unique identifier*/ << endl;
}

// define destructor
Point::~Point()
{
	cout << "Destructing now!!! " << (int)this /*unique identifier*/ << endl;
}

// public function to return private value of variable x
float Point::getX()
{
	return x;
}

int main()
{
	// create instance of class
	Point myLocation(23, 54, 32);

	// create another instance of class
	//Point anotherLocation;

	// calling constructor with args
	//Point thirdLocation(23, 14, 52);
	
	// return value of x
	cout << myLocation.getX() << endl;

	return 0;
}

AnswerRe: Problem with return value of private variable within class Pin
Md. Ali Naser Khan25-Mar-09 18:41
Md. Ali Naser Khan25-Mar-09 18:41 
GeneralRe: Problem with return value of private variable within class Pin
Michael Randolph25-Mar-09 18:57
Michael Randolph25-Mar-09 18:57 
GeneralRe: Problem with return value of private variable within class Pin
Md. Ali Naser Khan25-Mar-09 19:01
Md. Ali Naser Khan25-Mar-09 19:01 
GeneralRe: Problem with return value of private variable within class Pin
Michael Randolph25-Mar-09 20:40
Michael Randolph25-Mar-09 20:40 
GeneralRe: Problem with return value of private variable within class Pin
Cedric Moonen25-Mar-09 21:14
Cedric Moonen25-Mar-09 21:14 
GeneralRe: Problem with return value of private variable within class Pin
Niklas L26-Mar-09 1:25
Niklas L26-Mar-09 1:25 
AnswerRe: Problem with return value of private variable within class Pin
Stuart Dootson25-Mar-09 23:41
professionalStuart Dootson25-Mar-09 23:41 
GeneralRe: Problem with return value of private variable within class Pin
Michael Randolph26-Mar-09 19:14
Michael Randolph26-Mar-09 19:14 
GeneralRe: Problem with return value of private variable within class Pin
Stuart Dootson26-Mar-09 21:32
professionalStuart Dootson26-Mar-09 21:32 
GeneralRe: Problem with return value of private variable within class Pin
Michael Randolph27-Mar-09 2:40
Michael Randolph27-Mar-09 2:40 
QuestionHow can I remove vertical scrollbar from Microsoft web browser? Pin
Md. Ali Naser Khan25-Mar-09 17:54
Md. Ali Naser Khan25-Mar-09 17:54 
AnswerRe: How can I remove vertical scrollbar from Microsoft web browser? [modified] Pin
Yajnesh Narayan Behera26-Mar-09 3:35
Yajnesh Narayan Behera26-Mar-09 3:35 
Question"game" fast fingers Pin
Aljaz11125-Mar-09 8:18
Aljaz11125-Mar-09 8:18 
AnswerRe: "game" fast fingers Pin
Cedric Moonen25-Mar-09 8:21
Cedric Moonen25-Mar-09 8:21 
GeneralRe: "game" fast fingers Pin
Aljaz11125-Mar-09 8:26
Aljaz11125-Mar-09 8:26 
JokeRe: "game" fast fingers Pin
CPallini25-Mar-09 8:30
mveCPallini25-Mar-09 8:30 
GeneralRe: "game" fast fingers Pin
Aljaz11125-Mar-09 8:40
Aljaz11125-Mar-09 8:40 

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.