Search:

Type: Posts; User: defcon

Search: Search took 0.01 seconds.

  1. Replies
    10
    Views
    2,192

    in your game function, initilize b and w to...

    in your game function, initilize b and w to something, 0 I guess should be fine.
  2. Replies
    2
    Views
    8,057

    try: if (hoursWorked>40){ overtime =...

    try:


    if (hoursWorked>40){
    overtime = (hoursWorked-40)*1.5;
    hoursWorked = 40; // need to set this here,
    salary = ((hourlyWage * hoursWorked) + (overtime * hourlyWage));
    }
  3. Replies
    3
    Views
    1,078

    did you try this? #define...

    did you try this?


    #define MTrAllocatedObject(Type) MTrAllocatedObjectType<Type >
  4. Thread: for loop help

    by defcon
    Replies
    5
    Views
    1,007

    jmd15's code prints it in reverse order. ...

    jmd15's code prints it in reverse order.


    #include <iostream>
    using namespace std;

    int main() {
    int number;
    cout << "Enter number" << endl;
    cin >> number;
  5. Replies
    7
    Views
    941

    You need to assign the function call to...

    You need to assign the function call to something, else, the returned result is not useable.

    a = blabla(a)
  6. Replies
    7
    Views
    1,340

    What interested you to learn programming? I'd...

    What interested you to learn programming? I'd suggest you start to do some simple things related to that.

    Or solving some math problems are usually a good way to practice looping and logic.
  7. Replies
    6
    Views
    1,706

    Hi, glad to of helped. I am new to these forums...

    Hi, glad to of helped. I am new to these forums too, as you can see from my post date :)
  8. Replies
    6
    Views
    1,706

    using namespace std; allows you to use cout and...

    using namespace std; allows you to use cout and cin.

    If you did not have this line then you would have to put std::cout and std::cin in your code in place of cout and cin. In some cases this is a...
  9. Replies
    6
    Views
    1,706

    You have to compare threatentry to each character...

    You have to compare threatentry to each character individually, in your while loop.

    To shorten the while loop and make the code more readable, I would suggest you do it like this:


    #include...
  10. Thread: What is Proper?

    by defcon
    Replies
    12
    Views
    3,993

    Personally, if you need more then a few of the...

    Personally, if you need more then a few of the std commands I just use the entire namespace. I feel that it makes the code more readable and the speed difference is not HUGE, is it?
  11. Thread: Help Needed !!

    by defcon
    Replies
    3
    Views
    1,247

    You will need two for loops to do it. Just draw...

    You will need two for loops to do it. Just draw the filler char everytime except when your loop counter varibles == 0 or the max row/col number.

    There may be a better way to do this, but this...
  12. Thread: 2D game map

    by defcon
    Replies
    9
    Views
    4,392

    Make a map editor for your game :) Or load data...

    Make a map editor for your game :) Or load data from text files.. that is how I've always done it but I don't make many games.
  13. Replies
    6
    Views
    1,176

    if you are using the standard namespace thne you...

    if you are using the standard namespace thne you don't need to put std:: in front of vector.


    #include <iostream>
    #include <vector>
    using namespace std;

    int main() {
    vector<int> myVect; //...
  14. Replies
    12
    Views
    1,741

    If something is 'read only', you can't change it,...

    If something is 'read only', you can't change it, logically. :p

    It looks like Dae gave a good code sample that should solve your problem, or atleast point you in the right direction.

    Good luck...
  15. Replies
    12
    Views
    1,225

    Yup ...

    Yup ...
  16. Thread: Templates

    by defcon
    Replies
    5
    Views
    1,328

    Start a new project with just the following code,...

    Start a new project with just the following code, see if that compiles. It should compile without any problems.


    template <typename Type> class Vector {
    public:
    Vector(Type,Type,Type);
    Type...
Results 1 to 16 of 17