Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7

Thread: C++

  1. #1
    New to the CF scene
    Join Date
    Oct 2009
    Location
    Saskatchewan
    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Post C++

    Ok so I'm learning my first language, I chose c++ because i'v heard alot about it. I went to Chapter's (bookstore) and bought "Sams teach yourself C++ in One Hour a Day"(60$) 3rd day and I'm on page.53/850 . I'm woundering if C++ can be used to make games and have c++ coding that makes the charachter move in all directions. What exactly can I make out of c++. What I'm learning right now seems sort of useless, defineing x and y variables into equations...Could someone teach/lead me in the direction of where/who I could learn this from?

  • #2
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    Yes, C++ can be used to make video games along with a host of other applications (browsers, email clients, BT clients, chat programs, etc.).

    The reason the book is having you do that is because you need to learn the concepts behind programming first. You need to understand variables, functions, loops, classes, etc. in order to build any sort of large application.

    The language you use, in this case C++, is just a tool, the programming concepts are crucial because regardless of the language you use, they are the same. I know about 15 different programming languages myself, so I can attest at how important the concepts are.

    Keep working on your book, if you have questions on why something is done or there is stuff that is unclear, you can certainly post on here and myself and others can help explain.
    OracleGuy

  • Users who have thanked oracleguy for this post:

    ShawnC++ (10-06-2009)

  • #3
    Regular Coder BrickInTheWall's Avatar
    Join Date
    Mar 2009
    Location
    Munich, Germany
    Posts
    139
    Thanks
    1
    Thanked 13 Times in 13 Posts
    I'd say C++ is still the most used language for commercial games. As OracleGuy said, keep reading the book. You can program simple text based games while you're learning, in order to apply what you are learning. Later on, you can look at windows programming and programming with direct X to dive right into game programming. There are also several game programming libraries like Dark GDK that enable you to make games with ease, even for beginners.
    Call me Brick, if you like!

  • #4
    New to the CF scene
    Join Date
    Oct 2009
    Location
    Saskatchewan
    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts
    I'v got a question, my computer teachers says that using the "win32 console application" is "primitive" to use and that I should use things like "windows form" but the book I bought teaches me threw console application ( cout, cin ) and he thinks I use windows forms ( publicsub) stuff, what should I do?

  • #5
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    Quote Originally Posted by ShawnC++ View Post
    I'v got a question, my computer teachers says that using the "win32 console application" is "primitive" to use and that I should use things like "windows form" but the book I bought teaches me threw console application ( cout, cin ) and he thinks I use windows forms ( publicsub) stuff, what should I do?
    Console applications are hardly primitive, people still write them because they are ideal when you don't need a GUI. I've written plenty of console applications myself.

    The reason your book has you work with console applications is because you can focus on learning to program and not worry about getting user input and displaying it on the screen which is more complicated with a GUI.

    Not to say you can't write GUI apps in C++, that is of course possible and commonly done. It just adds a lot of complexity that can be confusing when you are first learning to program.
    OracleGuy

  • Users who have thanked oracleguy for this post:

    ShawnC++ (10-06-2009)

  • #6
    New to the CF scene
    Join Date
    Oct 2009
    Location
    Saskatchewan
    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Smile

    #include <iostream>
    int interface_Function()
    {
    using namespace std;
    int interface[3];
    interface[0] = 1;
    interface[1] = 2;
    interface[2] = 3;
    cout << interface[0] << " = Town"<< endl;
    cout << interface[1] << " = Armory"<<endl;
    cout << interface[2] << " = Tournament"<<endl;
    }
    int main()
    {
    using namespace std;
    cout << "Hi welcome to Gladiator Wars !!!!" <<endl;
    interface_Function();
    return 0;
    }

    I need help with this C++ code , errors = interface_Function does not return a value. I have experimented and failed. I,d like this code to run interface_Function in the main. Any help is appreciated =)

  • #7
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    Well what do you want it to return? If you don't need to return any values, then give it the return type void. e.g.

    Code:
    void interface_Function()
    You return something from a function using return btw.

    Also, you don't need to say using namespace std; in every function. Just put it at the top after the include line and that is sufficient.
    OracleGuy


  •  

    Posting Permissions

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