C++ Where to start. what to do?

ElderKingpin

Post in the anime section, or die.
Reaction score
134
So.. im getting into C++ (yayz) and i need to know a few things first...


1. What program do i use to MAKE the code.
2. What program do i use to RUN the code (as in make it come to life)
3. What program do i use after i completed my work i can play the "game"
4. When i asked my dad about it. He didnt seem to mind that i was a newbie, he didnt even point out anything he just started into it.
5. He uses NetLinx (which he said you require a certificate to use) does that use C++?
 

Slapshot136

Divide et impera
Reaction score
471
1. there are plenty out there, I prefer visual studio

2. c++ creates .exe files, which can be run in windows, although you would usually also create an "installer" that copies over the files to an install directory (like under program files) an puts a shortcut on the desktop. also for testing purposes most programs that you write the code in can also run it, and these also usually have debugging features to help you analyze what it is doing while it is running.

3. your pick of windows - xp, vista, 7, etc. (i think older ones would work as well)
 

codemonkey

Code monkey not crazy, just proud.
Reaction score
66
>2 - c++ creates .exe files

Wrong. This only applies for windows

Visual Studio only works for windows and only works if you have the .NET framework.
 

ElderKingpin

Post in the anime section, or die.
Reaction score
134
the question for number 4 was. Is C++ something hard to pick up?

+

What am i supposed to do when i finished making my project, and i want to give it to someone. Do i have to put a special program with the project to run the project? or does windows run it on its own
 

codemonkey

Code monkey not crazy, just proud.
Reaction score
66
C++ is extremely hard to pick up if it's your first real language, imo.

I recommend Python over C++.

For example if you wanted a hello world program in C++:

Code:
#include <iostream>
using namespace std;
void main()
{
  cout << "Hello World!" << endl;
}

or in Python:

Code:
print Hello World!
 

Slapshot136

Divide et impera
Reaction score
471
What am i supposed to do when i finished making my project, and i want to give it to someone. Do i have to put a special program with the project to run the project? or does windows run it on its own

like I said earlier, usually you would also make an installer that puts a shortcut on the desktop and the files where they should be, but in windows it just runs when you double click the file

and you can use c++ on linux computers, the question is as a starter, do you want to or care about that?

and i dont see the problem with learning c++ as a first language, sure it's not as easy as some other languages, but it helps you develop a deeper understanding for how things work rather then just how to do things
 

Slapshot136

Divide et impera
Reaction score
471
start making small projects and learn these basics:
cout
primitives like int, long, char, double, etc.
cin
comments
if/elseif/else
case
loops
arrays
functions

and these

#include <iostream> // to be able to use cout and cin
#include <string> // to be able to use strings
#include <fstream> // to write/read from files
#include <iomanip> // to format the output

and search for c++ sample programs and see how they work

and as far as using visual studio, to start out go to file -> new -> project
then general -> empty project, and give it a name
then on the left hand side you should see a "solution explorer", useing that, right click on Source Files and add a new item
add a new cpp file, and name it
then start coding, here's something to start from

Code:
#include <iostream>  // adds the iostream library that allows the program to accept input and display output
#include <string> // allows you to use strings

using namespace std; // std = standard

int main() // it is an int because it returns a number
{ // opens main
// code 
	cout << "Hello World" << endl; // the default first-program
	return 0; // when main returns 0, it indicates the program finished successfully, any other return helps figure out what went wrong
} // ends main

then to test your code, you can run it without debugging (you first need to build it, it will ask you if you havent already), or in debug mode where it pauses at places you pick (by clicking to the left of the code and placing a red dot on that line)
 

Lyerae

I keep popping up on this site from time to time.
Reaction score
105
Really, as someone who's tried to learn C++, and failed, I can honestly say you should learn a language like Python first, which is what I currently know (I'm still learning, but I understand a lot of it).

It's much easier to understand basic programming concepts, when your learning an easy language, as opposed to something as complex as C++.
 

Tru_Power22

You can change this now in User CP.
Reaction score
144
C++ is extremely hard to pick up if it's your first real language, imo.

I recommend Python over C++.

For example if you wanted a hello world program in C++:

Code:
#include <iostream>
using namespace std;
void main()
{
  cout << "Hello World!" << endl;
}

or in Python:

Code:
print Hello World!

Yeah, but with C++ shares things with many languages and is widely used.

If you want to get started with C++ go out and buy a book.
 

Samael88

Evil always finds a way
Reaction score
181
so. what do i do >.<

My dad has an old C book but its from 1987

That book, the tutorial pages I posted and this forum should be enought for you to get started;)
I suggest that you use dev-c++ instead tho, since it is a bit more user friendly that microsofts alternative, I would say that when it comes to programming stay away from microsofts stuff with the exception from includes like windows.h.
It tends to make life a bit easier;)

Edit:
@Lyerae: If you failed learning c++ and not python it is probably because you where to distracted by other things to learn it properly.
I for one have only learned c++ this far and I can with ease understand most python tutorials and read thru python code and still get what it does with just c++ knowledge. I would say that c++ is the better of those two to start with, there are many languages that has taken after c and c++ in their syntax and I would say that python is one of those.

Edit2:
Oh, and Slapshot136: the namespace std as standard is only good to use in smaller programs, the bigger it get's and the more things you put into it the bigger the risk get's for it to get into conflict with something else. I would say that it is better to learn not to use it from the beginning than to do.
Here is an alternative when it needs to be used:
Code:
std::cout << "hello world!";
 

Lyerae

I keep popping up on this site from time to time.
Reaction score
105
> If you failed learning c++ and not python it is probably because you where to distracted by other things to learn it properly.

Nope. No distractions.
C++ is just too advanced for a lot of people to start with.
 

Vestras

Retired
Reaction score
248
C++ is extremely hard to pick up if it's your first real language, imo.

I recommend Python over C++.

For example if you wanted a hello world program in C++:

Code:
#include <iostream>
using namespace std;
void main()
{
  cout << "Hello World!" << endl;
}

or in Python:

Code:
print Hello World!

So many people use this example and it's really just bullshit. Hello World in C++ might be longer than Python's, but C++ might have ways to do stuff faster than Python.

On topic: if you want to learn C++, learn C# first. It's very simple, and gives a good feeling when you start C++. I recommend that one.
 

codemonkey

Code monkey not crazy, just proud.
Reaction score
66
Python is an interpreted language, meaning no compiling is necessary. They both boil down to machine code anyways.

Really Python is miles easier to learn than C++ if you're a complete beginner.

And Python has more functionality than C++ for the more advanced users, it is a high level programming language.

C++ being a middle level language.

I certainly understand a lot of people wanting to stick with C++/C as it has been around for awhile and lots of games + engines were made in it, but I think it's best for beginners to steer clear from it.

Just my 2 cents.
 

ElderKingpin

Post in the anime section, or die.
Reaction score
134
That book, the tutorial pages I posted and this forum should be enought for you to get started;)
I suggest that you use dev-c++ instead tho, since it is a bit more user friendly that microsofts alternative, I would say that when it comes to programming stay away from microsofts stuff with the exception from includes like windows.h.
It tends to make life a bit easier;)

Edit:
@Lyerae: If you failed learning c++ and not python it is probably because you where to distracted by other things to learn it properly.
I for one have only learned c++ this far and I can with ease understand most python tutorials and read thru python code and still get what it does with just c++ knowledge. I would say that c++ is the better of those two to start with, there are many languages that has taken after c and c++ in their syntax and I would say that python is one of those.

Edit2:
Oh, and Slapshot136: the namespace std as standard is only good to use in smaller programs, the bigger it get's and the more things you put into it the bigger the risk get's for it to get into conflict with something else. I would say that it is better to learn not to use it from the beginning than to do.
Here is an alternative when it needs to be used:
Code:
std::cout << "hello world!";

Link?
 

Tru_Power22

You can change this now in User CP.
Reaction score
144
> If you failed learning c++ and not python it is probably because you where to distracted by other things to learn it properly.

Nope. No distractions.
C++ is just too advanced for a lot of people to start with.

C++ was the language I started with. I actually felt kind of weird when I started using python.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top