|
Well I;m asking these questions after reading Scott Meyers. he intent is to get a better clarity. I'n sure u guys too went to school and asked questions before becoming what u r now . You can ignore if you do not want to answer.
|
|
|
|
|
tom groezer wrote: Well I;m asking these questions after reading Scott Meyers. he intent is to get a better clarity.
There are a lot of other good books...
Try to code a bit too.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
The new-operator allows you to do other things before or just after the allocation of the memory and before the call the the constructor.
You can for example use the new-operator to create ("new") objects in a different memory scope.
I have used this to work with my own memory manager located on stack.
codito ergo sum
|
|
|
|
|
If you're asking what the difference is between "operator new " and "the new operator", there is none. Just two ways of referring to the same thing.
|
|
|
|
|
I'm stuck!
Ive created and application using C++, openGL and SDL and now want to release it for use on windows.
Thing is I cant seem to find a simple way to do this. Ive been on MSDN which give tutorials on ClickOnce and Windows installer deployment but dont really understand what I want to do.
Could anyone tell me the or give me some pointers on what steps I should take so that I am able to get my program in a format which I can distribute to whoever I want?
Any help would be appreciated
kevin
|
|
|
|
|
Kevin Brydon wrote: Could anyone tell me the or give me some pointers on what steps I should take so that I am able to get my program in a format which I can distribute to whoever I want?
Go to the search field above
Type OpenGL into the field
Push the button Go!
|
|
|
|
|
how very witty
anyone else have any suggestions?
|
|
|
|
|
Does anyone know any way to get the selected item off of a CTreeCtrl on a different dialog? The only thing I have thought of is to save the index of the selected value to a database every time it changes.
Thanks
-- modified at 17:05 Friday 13th July, 2007
|
|
|
|
|
Can we discuss the design criteria for the usage of set_new_handler. Why is it used instead of using exceptions.
Also what is the implication os using the same at a class level.
|
|
|
|
|
tom groezer wrote: Can we discuss the design criteria for the usage of set_new_handler. Why is it used instead of using exceptions.
Because you cannot handle memory leaks with exceptions. When an app runs out of memory it's mostly due to memory leaks(1). By definition you cannot recover memory leaks. So the best thing to do is to just terminate the app via the new handler.
(1) only Java Swing apps run out memory inherently.
|
|
|
|
|
you would only use this if you're developing a debugger or some kind of diagnostic application use to monitor a process access to memory. other than this you don't need to worry about it!
Yours Truly, The One and Only!
|
|
|
|
|
How do I subscribe to comp.lang.C++.moderated in outlookexpress or in RSS reader? Also are there any good C++/VC++ admirable newsgroup to which one can subscribe to?
|
|
|
|
|
Try first the non-moderated comp.lang.c++
No subscription necessary, just post the same way as to any other newsgroup. Before posting read the C++ FAQ[^].
|
|
|
|
|
How can it be used form outlook or an rss reader?
|
|
|
|
|
tom groezer wrote: How can it be used form outlook or an rss reader?
Sorry, I don't use Outlook. Put the following line into your browser's address field and see what happens:
news://comp.lang.c++
|
|
|
|
|
tom groezer wrote: How can it be used form outlook
It can't, without a plugin of some sort. You can use OE, however.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I cant seem to find this anywhere, but does anyone know what WinAPI to call when doing a lookup of the windows Domain/Workspace ? Ive searched MSDN over and over and cant find a thing that has to do with what im trying to do. I thought GetDomainName() would work, but to no avail. It doesnt, thanx in advance!
|
|
|
|
|
main()<br />
{<br />
int x=2.4;<br />
if(x==2.4)<br />
cout<<"true";<br />
else<br />
cout<<"false";<br />
return 0;<br />
}
Well it is not working, help me out please!
Spread wat u Know!
|
|
|
|
|
You cannot compare FP numbers in this fashion. You'll need something like:
if (fabs(x - 2.4) < 0.00001)
cout << "true" << endl; See here for more.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thnx but I did visit Bruce Dawson
But couldnt get it in nutshell
Please will u?
Spread wat u Know!
|
|
|
|
|
in short, a computer cannot "always" represent a floating point number accurately in binary format, and a precision error will be inserted when converting back and forth between the floating point number and the binary representation.
for example :
2.4 can be "errored" to something like either 2.39999999 or 2.40000001
|
|
|
|
|
Thnkx a lot..............
Does this mean IEEE32/64 arent good enough to store FPs accurately AND wat when we use the same number to print on screen......i mean how is that FP printed accurately?
N sorry it is actually float x=2.4;
Spread wat u Know!
|
|
|
|
|
Cmania wrote: int x=2.4;
you need to go look at the definition of "int"
|
|
|
|
|
Here's an CodeProject article that discusses this issue:
http://www.codeproject.com/tips/FloatingPointEquality.asp[^]
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
I am writing an MFC DLL and I am getting the following linker error:
error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> > CApp::m_sDllVersion" (?m_sDllVersion@CApp@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
I have the CApp class decalred thus:
#pragma once<br />
<br />
#ifndef __AFXWIN_H__<br />
#error include 'stdafx.h' before including this file for PCH<br />
#endif<br />
<br />
#include "resource.h"
#include <string><br />
<br />
using namespace std;<br />
<br />
class CApp : public CWinApp<br />
{<br />
public:<br />
CApp();<br />
<br />
static const char* GetDllVersion( void );<br />
<br />
public:<br />
virtual BOOL InitInstance();<br />
<br />
DECLARE_MESSAGE_MAP()<br />
<br />
private:<br />
static string m_sDllVersion;<br />
};
|
|
|
|