|
Thanks again for the quick response ravi.
I made the changes to :
double Point3D::distanceFrom(Point3D& p3D)
{
return sqrt((p3D.getX() - this.getX()) * (p3D.getX() - this.getX()) +
(p3D.getY() - getY()) * (p3D.getY() - getY()) +
(p3D.zCoord - getZ()) * (p3D.zCoord - getZ()));
}
I am still getting that error.
Funny, when i comment the first line out
double Point3D::distanceFrom(Point3D& p3D)
{
return sqrt(//(p3D.getX() - this.getX()) * (p3D.getX() - this.getX()) +
(p3D.getY() - getY()) * (p3D.getY() - getY()) +
(p3D.zCoord - getZ()) * (p3D.zCoord - getZ()));
}
it's a okay!
here are my declarations from my point class...
double Point::getX() const {
return xCoord;
}
double Point::getY() const {
return yCoord;
}
|
|
|
|
|
nevermind, i got it. thanks Ravi!
|
|
|
|
|
etm124 wrote: return sqrt((p3D.getX() - getX()) * (p3D.getX - getX()) +
The third getX is missing the parentheses to make it a function call.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
If have MFC MDI application how can I use all new Office 12 styles in my application.
Do you know is any SDK available to get this styles from Office 12
If yes is it unmanaged and is it support Windows XP?
I saw a lot of third party components which looks similar to Blue Ribbon but nothing from the MIcrosoft.
Thanks for any info.
|
|
|
|
|
CodeJock has them.
http://www.codejock.com/[^]
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Thanks very good selection
|
|
|
|
|
I think the blue Ribbon is fugly, please don't copy it.
But you should probably wait until Office 12 is released before starting to copy its UI. Look at all the poor folks that copied the beta 1 Ribbon - they now have to redo all their work because the beta 1 UI was just temporary.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
Thanks, I like your comment
|
|
|
|
|
typedef string *ptrstr;<br />
const ptrstr cstr; //this is wrong
What is the type of cstr ?
What underlying type does a pointer const ptrstr represent?
Not a question, more in the form of a quiz.
They say most progammers interperate this wrong.
|
|
|
|
|
With your games you are sending real doubts down to the other page...
|
|
|
|
|
Yeah, most programmers will really "interperate", especially those who post such questions.
|
|
|
|
|
#hackC++ wrote: typedef string *ptrstr;
const ptrstr cstr; //this is wrong
What is the type of cstr ?
What underlying type does a pointer const ptrstr represent?
Somebody please ask #hackC++ to use this way to get his answer by:
std::cout << typeid(cstr).name();
Maxwell Chen
|
|
|
|
|
Looks like he has just discovered C++ for himself and it thrills him...
|
|
|
|
|
#hackC++ wrote: What is the type of cstr ?
It is a const ptrstr , but it will need to be initialized.
#hackC++ wrote: Not a question, more in the form of a quiz.
How can it not be a question if it ends with a question mark?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
my grammer and english is not what you call "good". bare with me. please.
string *const cstr;
is the correct way.
-- modified at 14:56 Tuesday 25th April, 2006
|
|
|
|
|
I think David is he not she, so he would not want to bare with you.
|
|
|
|
|
#hackC++ wrote: string *const cstr;
is the correct way.
You wanted to know what cstr was, not ptrstr . cstr is a const ptrstr , while ptrstr is a string* .
In any case, you are mistaken. While const string *cstr and string const *cstr are interchangeable, string* const cstr is completely different.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
HI all )
I included A class to my project ans when try to compile get this error :
c:\Documents and Settings\...\myprogrm.cpp(1381): fatal error C1010: unexpected end of file while looking for precompiled header directive
what can be wrong ?
thank you
-- modified at 14:15 Tuesday 25th April, 2006
|
|
|
|
|
move the #include "stdafx.h" statements in every .cpp files of your project at the top of the other includes...
|
|
|
|
|
|
What I was wondering is when i put.
const size_t array = 3;
int ca[array] = {0,1,2};
cout << ca << endl;
The program prints 0x75dfc0 (or something like that, I'm just guessing)
that output tells me nothing. Is it the memory address or what.
it all seems a little confusing.
|
|
|
|
|
#hackC++ wrote: const size_t array = 3;
int ca[array];
1. you cannot do this. you must use either macros or dynamic memory allocation.
#hackC++ wrote: cout << ca << endl;
this prints ca which is a pointer to the first int which compounds the array, so what you get is actually the address at which the array has been allocated...
if you want to print each elements in the array, iterate over it.
|
|
|
|
|
Would it be easier to use vectors in most cases?
|
|
|
|
|
#hackC++ wrote: Would it be easier to use vectors in most cases?
depends what you need to do with it.
if you need an array which size need to change often, then yes, vector is certainly a good choice.
please explain what you want to do with that array if you want me to advise you better.
|
|
|
|
|
#hackC++ wrote: const size_t array = 3;
int ca[array];
v2.0 wrote: 1. you cannot do this. you must use either macros or dynamic memory allocation.
Yes we can, because it is const.
At least my GCC compiles this code.
Maxwell Chen
|
|
|
|