Well, there is a better way to do it, it's always best to allocate memory that goes together all at once. Remember, using a C-cast you can change anything into anything else. |
|
Well, there is a better way to do it, it's always best to allocate memory that goes together all at once. Remember, using a C-cast you can change anything into anything else. |
|
Wow, quick reply |
|
April Ryan is my friend,
Every sorrow she can mend.
When i visit her dark realm,
Does it simply overwhelm.
No, using C functions is very common. C functions are very very fast. Don't use C headers. ie #include <ctime> instead of #include <time.h> |
|
Oops. I forgot a const at operator |
|
Mostly, yeah. But I don't get why you use assert. I thought the point of an assert statement was to halt program execution. Would it not be more suitable to use an if statement? |
|
April Ryan is my friend,
Every sorrow she can mend.
When i visit her dark realm,
Does it simply overwhelm.
Yes, asserts halt operation, but only in debugging mode. In release mode, they are compiled out, so no checks are done. This helps you make your code correct before you release it. |
|
const essentially means "read only" so |
|
Bookmarks