Click here to Skip to main content
15,908,842 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Need help with mutex Pin
auralius manurung21-Oct-08 19:43
auralius manurung21-Oct-08 19:43 
GeneralRe: Need help with mutex Pin
Mark Salsbery21-Oct-08 20:06
Mark Salsbery21-Oct-08 20:06 
QuestionDWM - desktop windows manager Pin
Sarriss21-Oct-08 5:31
Sarriss21-Oct-08 5:31 
AnswerRe: DWM - desktop windows manager Pin
Richard Andrew x6421-Oct-08 5:43
professionalRichard Andrew x6421-Oct-08 5:43 
GeneralRe: DWM - desktop windows manager Pin
Sarriss21-Oct-08 5:52
Sarriss21-Oct-08 5:52 
GeneralRe: DWM - desktop windows manager Pin
Richard Andrew x6421-Oct-08 6:08
professionalRichard Andrew x6421-Oct-08 6:08 
GeneralRe: DWM - desktop windows manager Pin
Sarriss21-Oct-08 7:29
Sarriss21-Oct-08 7:29 
QuestionNeed help in C++ classes Pin
Quecumber25621-Oct-08 4:59
Quecumber25621-Oct-08 4:59 
Good morning,
I need help in designing a class in C++. For experimental purposes I started with something simple.

// Header File Planets.h Declares class Planets.
class Planets
{
public:
double Mercury;

private:
double weight;
};

//Implementation file Planets.cpp implements the member
//functions of Class Planets.
#include "stdafx.h"
#include "Planets.h"

double Planets::Mercury
// Pre: Earth weight.
// Post: Earth weight times the gravitation constant
// of Mercury - 0.4155.
{
return wgh * 0.4155;
}

// MT_Planets.cpp : main project file.

#include "stdafx.h"
#include <iostream>
#include "Planets.h"
using namespace std;

int main()
{
double iWgh = 235.6;
double MyWgh;
MyWgh = Planets.Mercury(iWgh);
cout << "My weight on Mercury is: " << MyWgh << endl;
system("pause");
return 0;
}

When I try to compile the project I get the following error:
Error 1 error C2063: 'Planets::Mercury' : not a function c:\Documents and Settings\Mark McCumber\My Documents\Visual Studio 2005\Projects\Visual C++\MT_Planets\MT_Planets\Planets.cpp 10

Can someone explain to me what I'm doing wrong?

Quecumber256
AnswerRe: Need help in C++ classes Pin
Rajesh R Subramanian21-Oct-08 5:22
professionalRajesh R Subramanian21-Oct-08 5:22 
GeneralRe: Need help in C++ classes Pin
Quecumber25621-Oct-08 6:02
Quecumber25621-Oct-08 6:02 
QuestionRe: Need help in C++ classes Pin
CPallini21-Oct-08 6:45
mveCPallini21-Oct-08 6:45 
AnswerRe: Need help in C++ classes Pin
Quecumber25622-Oct-08 3:42
Quecumber25622-Oct-08 3:42 
GeneralRe: Need help in C++ classes Pin
CPallini22-Oct-08 3:44
mveCPallini22-Oct-08 3:44 
GeneralRe: Need help in C++ classes Pin
Quecumber25622-Oct-08 5:25
Quecumber25622-Oct-08 5:25 
GeneralRe: Need help in C++ classes Pin
CPallini22-Oct-08 8:52
mveCPallini22-Oct-08 8:52 
AnswerRe: Need help in C++ classes Pin
Iain Clarke, Warrior Programmer21-Oct-08 6:18
Iain Clarke, Warrior Programmer21-Oct-08 6:18 
GeneralRe: Need help in C++ classes Pin
Quecumber25621-Oct-08 6:40
Quecumber25621-Oct-08 6:40 
QuestionGetting OS theme Pin
divilin thiyagaraj21-Oct-08 4:25
divilin thiyagaraj21-Oct-08 4:25 
AnswerRe: Getting OS theme Pin
David Crow21-Oct-08 4:51
David Crow21-Oct-08 4:51 
GeneralRe: Getting OS theme Pin
divilin thiyagaraj21-Oct-08 21:08
divilin thiyagaraj21-Oct-08 21:08 
GeneralRe: Getting OS theme Pin
Rajesh R Subramanian21-Oct-08 21:15
professionalRajesh R Subramanian21-Oct-08 21:15 
QuestionRe: Getting OS theme Pin
David Crow22-Oct-08 3:13
David Crow22-Oct-08 3:13 
AnswerRe: Getting OS theme Pin
Rajesh R Subramanian21-Oct-08 4:59
professionalRajesh R Subramanian21-Oct-08 4:59 
Questionhow to get the system IP address in mfc Pin
mathy21-Oct-08 3:30
mathy21-Oct-08 3:30 
AnswerRe: how to get the system IP address in mfc Pin
Iain Clarke, Warrior Programmer21-Oct-08 3:47
Iain Clarke, Warrior Programmer21-Oct-08 3:47 

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.