Jump to content


Check out our Community Blogs

MeTh0Dz

Member Since 28 May 2008
Offline Last Active May 08 2018 03:49 PM
-----

Posts I've Made

In Topic: Few C questions

03 May 2010 - 02:40 PM

true is a c++ keyword. In c, there is no built-in boolean type, hence, true, false, bool means nothing to c unless you instruct it on how to interpret them.

BTW, I failed to spot "while(true)" in your code. You must have hidden it somewhere else :)


Wrong.

C99 has stdbool.h, which includes bool, true, and false.

In Topic: Whhat is wrong with this isdigit

28 April 2010 - 10:44 AM

Here is my solution :D

#include <iostream>

using namespace std;

int main()
{
    char number;

    while (cin >> number)
    {
        if (number > 57 || number < 48)
            cout << number << " Is not an integer!" << endl;
        else
            return 0;
    }

}



or you can always do it the other way around :D exit if it does not enter an integer!

#include <iostream>

using namespace std;

int main()
{
    int number;

    while (cin >> number)
        cout << number << " Is an integer!" << endl;

    cout << "The last input is not an integer!" << endl;

    return 0;
}


The first solution is bad because it's platform dependent. You are assuming that the charset is going to be ascii. This is a bad thing to assume.

The second 'solution' is bad because it doesn't even attempt to do what the OP asked for.

In Topic: Steps to making a FPS game?

27 April 2010 - 10:24 PM

Determining the trajectory of moving objects for starters.

In Topic: Steps to making a FPS game?

27 April 2010 - 08:24 PM

cr4zyh4ch3r, doesn't know what he's talking about. <sarcasm> Crazy I know. </sarcasm>

Of course you can write a 3D shooter in python.

First you need to learn Python to a very proficient level. Make sure you know math at least up too trigonometry. Then you need to become familiar with a graphics framework and a game engine. And yay you can't write a game.

In Topic: Writing a driver - some help ?

23 April 2010 - 07:16 AM

A couple of tutorials on C aren't going to help you much in the way of writing drivers.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download