They don't appear to be. What's odd to me is the very concept of overloading NEW. New strikes me as too basic to overload. That's what confuses me.
Type: Posts; User: Grins2Pain
They don't appear to be. What's odd to me is the very concept of overloading NEW. New strikes me as too basic to overload. That's what confuses me.
void* Point::operator new (size_t bytes)
{
Block *res = freeList;
return used < maxPoints
? &(blocks[used++])
: (res == 0 ? 0
: (freeList = freeList->next, res));
}
...
I've noticed that you can put constants within a class, and then change them as if they were normal values by const flagged member functions. I want to know, what do you expert programmers out there...
I can use DirectX without Win32 ?! Tell me more!:D
(I have almost no interest in apps programming, no offense to all the fine applications programmers of the world)
I am now comfortable with classes, pointers, functions, scope, overloading, etc... Now my question is, how much is enough for someone to go ahead and go Win32? To be honest, I really don't want to...
Benny, Hybrid was talking about my joke program, the random value setter.
Hey, I got a question for you and hybrid. I'm interested in getting started with 2D directdraw and direct sound. What...
:rolleyes: In the future I'll remember that. I'd almost pay to know exactly what I managed to target by accident. Almost makes me want to make a program that addresses random memory locations with...
Actually, long term, I want to learn Win32 then MFC, then DirectX. So I'll definately be cracking the books on Win32.
Tell me, can direct X simply be called fullscreen from a console app, I...
Is there a standard clearscreen command for console apps?
Would it be better to make the array constant to boot?
EDIT: How can I convert a number grabbed via CIN from a Char number to a INT? I.E. make '1' = 1
Yeah, this program isn't much, it isn't even PONG, but it does feel good to be getting it finished. It's a bad habit to leave programs undone.
EDIT: By the way, it doesn't have any memory leaks...
:eek:
Four hours, four stinking hours I overlooked that!
Thanks Benny, your eyes are sharper than mine!
That's a Bool function that's set to return true. What's the problem?
Thanks for pointing that out, but it still doesn't work. I think the problem may lie in the functions I am using to actually manipulate the flags, I'll look more closely at the checking routine...
It DOES compile, but it's almost like I can't effect any change in the elechairs pointer. I am almost completely sure my bit flag check works. For "lowering" a flag, I take 2 to the power of (bit -...
This was a silly little program I made to get a handle on classes, but I think I've really butchered some part of this, can anyone spot my mistake?
*by the by, it's not entirely finished, but...
Can anyone spot anything glaringly wrong with this function? It's supposed to change one of the bit flags in a int with a pass-by referance. If it matters, the int in question is a dynamically...
They COULD BE MADE to point to the same location, but as shown they would be seperate?
Lyx :) Yeah prolly, sorry, I'll quit making so many posts if it's a problem.
By the by, do you still need...
So it IS necessary for the constructor to initialize any dynamic variables internal to the class?
Also, by the way, b1's *a isn't the same value as b2's *a is it? Or would they be seperate values...
If I create an instance of a class, and then delete it, I assume that the non-dynamic variables are all cleaned up automatically. The destructor is supposed to be used for dynamically allocated...
Now, this is going to seem REALLY newbish, but in the case of
aClass *myClass = new aClass;
do I do
delete myClass;
Sorry to post so many newbie questions, but is this correct?
aClass *myClass = new aClass;
is, afaik, the way that you creat a new class object dynamically.
My question is, is this the...
Does the compiler typically automatically use RAM, or do you have to explicitly tell it to use RAM? Does using ram have something to do with dynamic allocation.
Sorry if this seems newbish, I...
Can you omit the delete statement and see if it still outputs garbage?
On my compiler it outputs exactly what it should.
The delete statement should, normally, free the memory, right? To me,...
Hey, thanks for the swift response:) I'll do just that!