...

View Full Version : C++



ShawnC++
10-04-2009, 03:30 AM
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?

oracleguy
10-04-2009, 04:15 AM
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.

BrickInTheWall
10-04-2009, 04:21 PM
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.

ShawnC++
10-05-2009, 11:54 PM
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?

oracleguy
10-06-2009, 12:38 AM
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.

ShawnC++
10-08-2009, 06:41 PM
#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 =)

oracleguy
10-08-2009, 06:49 PM
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.



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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum