Results 1 to 7 of 7

Thread: Console Programming

  1. #1

    Thread Starter
    Hyperactive Member Amon Ra's Avatar
    Join Date
    Feb 2001
    Location
    In some cave on Uranus...
    Posts
    500

    Talking

    Hey guys, i have followed ur advices, and done quite a bit of console programming. Now, when do i know if i can start Windows programming? Cuz the tuts i found dont go very far, and so i dont know what is required to go into windows programming. Please answer, i really want to get into this
    Thanx for givin' a helpful answer
    Amon Ra
    The Power of Learning.

  2. #2
    Junior Member Forger's Avatar
    Join Date
    Feb 2001
    Posts
    19
    I think you should learn up to classes before you start looking at windows programming. I just started windows programming and found it isn't nearly as easy as console programming. It looks like it will take forever to memorize, so I recommend taking parksies example and just learn enough to modify it. So, as long as you have a good basic understanding of the basic functions of console programming you could start windows programming
    Forger
    As in creator, not copier.

  3. #3

    Thread Starter
    Hyperactive Member Amon Ra's Avatar
    Join Date
    Feb 2001
    Location
    In some cave on Uranus...
    Posts
    500

    Red face Ok

    Ok thanx. BTW i am practicing classes, but what is a constructor??
    Amon Ra
    The Power of Learning.

  4. #4

    Thread Starter
    Hyperactive Member Amon Ra's Avatar
    Join Date
    Feb 2001
    Location
    In some cave on Uranus...
    Posts
    500

    Lightbulb Nevermind

    I found out that a constructor in a class was to initialize the class. Now i know how to define a function outside of the class:

    class Computer //Standard way of defining the class
    {
    public:
    //This means that all of the functions below this(and any variables)
    //are accessible to the rest of the program.
    //NOTE: That is a colon, NOT a semicolon...
    Computer();
    //Constructor
    ~Computer();
    //Destructor
    void setspeed(int p);
    int readspeed();
    //These functions will be defined outside of the class
    protected:
    //This means that all the variables under this, until a new type of
    //restriction is placed, will only be accessible to other functions in the
    //class. NOTE: That is a colon, NOT a semicolon...
    int processorspeed;
    };
    //Do Not forget the trailing semi-colon
    Computer::Computer()
    { //Constructors can accept arguments, but this one does not
    processorspeed = 0;
    //Initializes it to zero
    }

    Computer::~Computer()
    { //Destructors do not accept arguments
    }
    //The destructor does not need to do anything.

    void Computer::setspeed(int p)
    { //To define a function outside put the name of the function
    //after the return type and then two colons, and then the name
    //of the function.
    processorspeed = p;
    }

    but is there a way to define a function inside the class?
    thanx for answering
    Amon Ra
    The Power of Learning.

  5. #5

    Thread Starter
    Hyperactive Member Amon Ra's Avatar
    Join Date
    Feb 2001
    Location
    In some cave on Uranus...
    Posts
    500

    Exclamation Problem

    I think i got lost in practicing classes. Does any of you know a good place to learn how to write classes, or even better, could any of you explain to me how? Thanx!
    If you are nice enough to explaint to me, then in the explanation, could u tell me all the basics, but also the main concepts and a few tips? Thanks a lot
    Amon Ra
    The Power of Learning.

  6. #6
    Frenzied Member CyberCarsten's Avatar
    Join Date
    Sep 1999
    Location
    Aalborg Ø, Denmark
    Posts
    1,544
    I'm also new to C++, and I just recently started console programming by reading a billion of beginners tutorials!!(They paid of) Yesterday I got the book Windows Game Programming for Dummies, which shows you how make your own games in C++ with DirectX. The best though, is that, is use 5 or 6 chapters learning you to make windows applications. I would recommend this book!
    razor
    Software Engineer Student, Aalborg University, Denmark
    http://www.cs.auc.dk

    My email at AUC: will get a new email soon
    My website: http://www.razorsoftware.net


    Windows XP Pro/ Gentoo Linux (Laptop)
    Windows XP Pro (Home PC)

  7. #7
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    Boulder, Colorado, USA
    Posts
    325
    Amon Ra I think you are a little confused... lemme try to explain

    [CODE]

    // basic form for a class

    class MyClass
    {
    public:
    // constructors (intializing the classes)
    MyClass(....);

    // destructors
    ~MyClass();

    // define public functions that others can use to access private data in your class

    protected:
    // define "non visible" functions and data that can only be seen by this class and classes that inherit from this class.

    private:
    // define "non visible" functions and data that can only be seen by the this class

    };

    [CODE]

    I would recommend buying the book "C++ from the Ground Up" it is an excellent book and covers almost all the topics in C++
    -Shickadance

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width