Search:

Type: Posts; User: rmullen3

Page 1 of 14 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    2
    Views
    1,051

    Heh

    I should've just use vector in the first place. What was I thinkin.

    Thanks, problem solved
  2. Replies
    2
    Views
    1,051

    I always have memory errors in destructors

    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 ()
  3. Thread: Hackers Movie

    by rmullen3
    Replies
    18
    Views
    2,469

    ...

    Ick. Angelina Jolie is hideous... looking and acting.
  4. Replies
    7
    Views
    1,890

    ~

    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.
  5. ~

    Sorry to bump... but can anyone help me further? If not, that's okay
  6. ~

    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...
  7. ~

    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 *...
  8. Getting right sprite direction in 3D world - like FFT or Xenogears

    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...
  9. Replies
    14
    Views
    1,631

    ~

    (s)he's thinking pascal records
  10. Window priority handling for a GUI - data structure

    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...
  11. Replies
    2
    Views
    989

    ~

    1. USE CODE TAGS
    2. That's the whole program?
  12. Replies
    4
    Views
    1,073

    ~

    :eek:
  13. Replies
    7
    Views
    1,129

    ~

    sorry, picked through the code too quickly
  14. Replies
    7
    Views
    1,129

    ~

    Or make it static
  15. Replies
    1
    Views
    875

    ~

    Ok: C doesn't have references, C++ does.

    If that's what you mean by reference type. It could easily not be. *runs*
  16. Replies
    3
    Views
    3,164

    ~

    std::sort<>()

    my favorite thing thus found in the standard
  17. Thread: wrong answer?

    by rmullen3
    Replies
    5
    Views
    1,255

    ~

    Here's the code using a switch statement, which is prettier:



    switch (month)
    {
    case 2: days = 28; break;
    case 4:
    case 6:
    case 9:
  18. Thread: Radix Sort

    by rmullen3
    Replies
    15
    Views
    3,914

    ~

    "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...
  19. Replies
    2
    Views
    842

    ~

    Why not just do:



    #include<stdio.h>
    #include<ctype.h>
    int main()
    {
    int n;
    printf("Enter a number:");
  20. ~

    Seems like you're just deleting temp, or something.
  21. Thread: int to char

    by rmullen3
    Replies
    18
    Views
    2,314

    ~

    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
    )
  22. Thread: int to char

    by rmullen3
    Replies
    18
    Views
    2,314

    ~

    Oh, my mistake. Why is itoa not in the standard and atoi is?
  23. Thread: int to char

    by rmullen3
    Replies
    18
    Views
    2,314

    ~

    Just use the standard itoa. it's in <cstdlib> I think?
  24. Thread: reverse

    by rmullen3
    Replies
    5
    Views
    1,028

    ~

    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
  25. Thread: reverse

    by rmullen3
    Replies
    5
    Views
    1,028

    ~

    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;
Results 1 to 25 of 332
Page 1 of 14 1 2 3 4