I should've just use vector in the first place. What was I thinkin.
Thanks, problem solved
Type: Posts; User: rmullen3
I should've just use vector in the first place. What was I thinkin.
Thanks, problem solved
Crikey. Whenever I allocate memory off the heap and delete it in the destructor, my program crashes. A la:
num_steps = 2;
ai = new aistep [num_steps];
/* .... */
enemy::~enemy ()
Ick. Angelina Jolie is hideous... looking and acting.
ball.x += sin (ball_angle);
ball.y += cos (ball_angle);
(this could be wrong, I'm not thinking very strongly right now)
Remember that ball_angle must be in radians.
Sorry to bump... but can anyone help me further? If not, that's okay
Since the while loop is going to always run while choice isn't 12, eliminate that unnecessary "if choice == TWELVE" and just put the cout and the getch() after the while loop.
And, as said, int...
Alright heres my code:
const float radAngle = DEG2RAD (xAng);
const float radCam = DEG2RAD (CameraAngle);
vector3d D (pos + vector3d(pos.x * sin(radAngle), pos.y,
pos.z *...
This is a problem I have been trying hard to figure out and I can't. You know how in Final Fantasy Tactics and Xenogears the characters are billboarded sprites that change "directions" (flat images...
(s)he's thinking pascal records
Sorry if this isn't the right forum for this question, there's no 'general' programming so I assumed C++ was right.
Anyway, in my GUI, I have a bunch of windows. Now the question is how to...
1. USE CODE TAGS
2. That's the whole program?
:eek:
sorry, picked through the code too quickly
Or make it static
Ok: C doesn't have references, C++ does.
If that's what you mean by reference type. It could easily not be. *runs*
std::sort<>()
my favorite thing thus found in the standard
Here's the code using a switch statement, which is prettier:
switch (month)
{
case 2: days = 28; break;
case 4:
case 6:
case 9:
"By the way, I've tested it and using
++i is SLOWER than using i++ by a tiny amount. So if you need a speedier program, use i++"
While the computer is a strange animal, I don't see why postfix...
Why not just do:
#include<stdio.h>
#include<ctype.h>
int main()
{
int n;
printf("Enter a number:");
Seems like you're just deleting temp, or something.
Luigi, here's the xtoa function, maybe it will help you:
static void __cdecl xtoa (
unsigned long val,
char *buf,
unsigned radix,
int is_neg
)
Oh, my mistake. Why is itoa not in the standard and atoi is?
Just use the standard itoa. it's in <cstdlib> I think?
Luigi:
for abcd,
it first swaps the first and the last, becoming
dbca
then moves inward 1, and swaps the second from the first and the second from the last, becoming
Very similiar to my own strreverse:
__inline void strreverse (char* str)
{
char *last = str + (strlen(str) - 1);
for (char *p = last; str < p; ++str, --p)
{
char t = *str;