Search:

Type: Posts; User: cjmdjm

Search: Search took 0.00 seconds.

  1. Are you talking about where I say "Unit...

    Are you talking about where I say "Unit units[100]" in the definition of the "UnitCollection" class? Because the compiler says the error is in the "UnitCollection" constructor, but I never call the...
  2. Thanks for the help guys. I have started work on...

    Thanks for the help guys. I have started work on this program again after a busy week of other commitments. Using your advice, I have cleared up most of the problems. The program is a realtime...
  3. Ok, thanks, that clears things up with arrays. ...

    Ok, thanks, that clears things up with arrays. And I probably should have read the article you linked to before posting lol. But one more question. When passing in objects (instances of classes)...
  4. Functions that take arrays an objects as arguments...

    Hi all,

    I learned C/C++ a long time ago in high school, and since then I have been working mainly in java. Now I am doing a C++ project again, and I have set up a system of classes and structures...
  5. Replies
    1
    Views
    1,176

    What was wrong with my program?

    So, I just spent the last 3 or 4 hours fixing a bug in a program of mine. The program would compile, but then immediately crash as soon as it started running, with no explanation. The compiler gave...
  6. Replies
    16
    Views
    2,951

    Ok, I found the preprocessor directives tutorial...

    Ok, I found the preprocessor directives tutorial on this site and that is helping with a lot of this. I didn't know these things were called preprocessor directives so at first I didn't know there...
  7. Replies
    16
    Views
    2,951

    In the above code, why #define SOMEFILE_H, and...

    In the above code, why #define SOMEFILE_H, and not #include SOMEFILE_H? Perhaps I don't understand the difference between include and define. And the #endif goes at the very end of the header file?...
  8. Replies
    16
    Views
    2,951

    Awesome thanks guys. On a completely unrelated...

    Awesome thanks guys. On a completely unrelated note, my program is starting to get really long, with lots of class and function declarations ahead of the main function. I was thinking of separating...
  9. Replies
    16
    Views
    2,951

    So if I don't use "new" does it not call the...

    So if I don't use "new" does it not call the constructor? Because I was using Daved's method, but I want the constructor to be called, to initialize the position and orientation data.

    Thanks.
  10. Replies
    16
    Views
    2,951

    Ok, so both tabstop and Daved's solutions work...

    Ok, so both tabstop and Daved's solutions work fine. Thanks guys. But, in the interest of bettering my understanding of classes/pointers, what exactly does the "new" keyword do? I thought to...
  11. Replies
    16
    Views
    2,951

    Function that returns a class...

    So I am working on a software based 3d engine. I have a structure called triangle, and a class called object. The object class contains an array of triangles that make up that object, and...
  12. Replies
    23
    Views
    162,901

    Already did it, quite awhile ago actually. In...

    Already did it, quite awhile ago actually. In visual c#, with graphics handled via the windows GDI. I put in a timer object, which fired a timer event every few milliseconds. Each time the timer...
  13. Replies
    23
    Views
    162,901

    Wow dude, I downloaded the source to Geany, one...

    Wow dude, I downloaded the source to Geany, one of the .tar.gz files, and its huge. I am trying to find the actual code files (ie, .c or .cpp) to open in my compiler. I am trying to find the file...
  14. Replies
    23
    Views
    162,901

    Could be a good idea. Usually I work on small...

    Could be a good idea. Usually I work on small projects for a few days and then get bored with them, I have rarely done a long term project, and rarely work with other programmers. I am good with...
  15. Replies
    23
    Views
    162,901

    Any cool programming project ideas?

    Recently I have been bored and have been writing random programs just for fun (and for practice). Mostly simple projects that can be finished in a day or two.

    But Im running out of ideas. First...
  16. Replies
    3
    Views
    3,266

    Check tic tac toe winner

    I have a tic tac toe program. The board is stored in a two dimensional character array board[3][3]. Here is a function that is supposed to check if the player specified in the player argument wins....
  17. Replies
    4
    Views
    2,476

    Easy way for decimal-binary conversion?

    For a little challenge exercise i was doing i had to come up with a program that would take a decimal number as input and output it in binary form (ie 36 = 100100). I was successful in doing this,...
  18. Replies
    5
    Views
    946

    reply

    I'm a relative newbie to C++ myself, but here is my suggestion. Have the user input the letter and store it in a char variable (with cin >> char_variable). Then have the user enter their name and...
  19. Replies
    1
    Views
    788

    How do you cast a string as an integer?

    I have a number in a string (actually its a character array, c style string) and i want to put it in an integer variable. The character array simply contains one a digit in each index and then, of...
  20. Replies
    3
    Views
    2,698

    reply

    Wow i didn't know you could declare a string as, well, a string. I thought strings had to be declared as character arrays (ie char string[50]). Is there a different include file (other than...
  21. Replies
    3
    Views
    2,698

    Question on string concatenate (strcat)...

    I have a program with two strings. I want to copy part of the first string, up to the first space character in that string, into a separate string. Here is the section of code i wrote that is...
  22. Replies
    1
    Views
    1,317

    Newbie programmer, few quick questions...

    I have just started learning C/C++. As practice i started doing a few challenge exercises. I am working on one such exercise in which i must write a program which can decide if three given points...
Results 1 to 22 of 22