scanf is an evil function. getchar is much better.
Type: Posts; User: Shokwav
scanf is an evil function. getchar is much better.
I thought genbuffers returned an int for some reason :p Thanks guys! (Oh, and I'm using g++ in Eclipse Juno.)
memento::VertexBuffer<uint> buff;buff = memento::VertexBuffer<uint>();
this is the only bit where the class in question is utilized...
Where? it highlights the constructor, which makes no sense...
"..\src\VertexBuffers.h: In instantiation of 'memento::VertexBuffer<NumType>::VertexBuffer() [with NumType = unsigned int]':
..\src\memento_lib.cpp:31:30: required from here...
can anyone help me with this? i've been trying for 2 hours to fix this... I don't know why I'm getting this?
Instantiation:
memento::VertexBuffer<uint> buff;
buff =...
Yeah, I should have said dynamic objects, sorry.
Derp, I forgot the *...
This makes a lot of sense. I was wondering if there was any other deeper purpose, but this makes a lot of sense;...
A class... that's dynamic.
class foo{};
foo bar = new foo();
Can you someone please expalin to me the purpose of dynamic classes? I know HOW to do it, but I don't know WHY to do it. Arrays I understand, as you usually need the size to be determined at runtime....
Not sure what you mean; size_t typedefs to unsigned int?
Yeah, that worked, thanks.
Oops, I thought npos was private. :p
I've written a sort of... parser, for lack of a better term. What this simple function does is take a string, look for ANY AND ALL control codes (denoted by starting with "[" and ending with "]"),...
Dammit... alright, and thanks for the eerily instantaneous reply o.0
...So if it wasn't allocated with new, I shouldn't do it?
My computer is broken, so I can't test this; is it safe to delete this; on a class that may or may not have been allocated with new? For example:
class Potpie{
Potpie(Ingrediants);
void...
I have:
Graphics superclass (Draw, refresh, printtext, etc.)
GameObject superclass (Sprites, primitives, etc.)
Input superclass (Key/Mouse presses)
Event superclass (Contains flags, contains code...
Ah, so I do have to create multiple vectors to avoid the data loss of upcasting? Okay, that's what I thought. :P Thank both of you, this has answered my question; your example is also relatively...
Thank you, that really helps me; I can just add an extra overloaded method for any new types. However, for the array bit, do you think I should cast them to the base class to be stored in array? The...
I'm creating a game. I have a base Image class, with derived Decal and Primitive classes. I also have a seperate class named Frame that holds all Decals and Primitives. What's the best way to go...
Yes, yes, yes, I understand that new and delete are used in the libraries themselves; I was never denying that. Thank you all for your help.
I don't think I was clear enough in my original post. I understand what new and delete do. I already know STL uses them, obviously. I just don't see why you'd need them explicitly.
It's still useful to check the text files from standard input in GUI mode.
I don't really understand why one would want to use new in C++. I know what it does, but I don't understand WHY you'd use it. The main purpose I see is in arrays, but honestly, who uses arrays when...
I heard you could utilize in the g++ compiler the __attribute and __attribute__ keywords. What's the difference between these two? If __attribute__((noreturn)) can be used on a void function or a...
Ah, yes. Thanks to your help, I fixed code which now runs brilliant as small road animal in mid-summer day. Thank you, SOMA!