Jump to content

Hello, New and need a tutorial.

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
4 replies to this topic

#1
Cageman

Cageman

    Newbie

  • Members
  • Pip
  • 2 posts
Okay i'll start off by introducing myself. My name is jake, i'm 15 (outta school till January) and i want to learn c++. I have no experience in any coding at all, so i'm looking for a tutorial that starts from the beginning and will teach me the basics. I know it will take a lot of time and work to become fluent in c++ but i am willing to put in all the time and effort i need to learn it. So any help will be very appreciated, i looked through the tutorials, and they all seem to be very specific, i just need to learn the basics first. Thanks

~Cageman

#2
G_Morgan

G_Morgan

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 537 posts
I'd recommend you do some simple things. The first thing you nearly always do is a "hello world" application that simply outputs hello world to the command line. Then you go through things like a temperature converter (Fahrenheit/Celsius), looping to fill an array with numbers entered by the keyboard then averaging them (or outputting the biggest/smallest/sum/whatever).

A few things. Early on I'd stick with a text editor with a command line for running your compiler, IDE's add overhead in terms of all sorts of messy functionality you don't need, they also hide you from learning things you will need. You'll find, when you are going for large projects, that an IDE's automation tools quickly break down and the knowledge you will gain by learning to do things via the command line will enable you to fix it quickly.

Of course to do this you need to know where your compiler is and alter path variables so that they will work via the CLI, not difficult but can be awkward if you don't know how to do it.

#3
Cageman

Cageman

    Newbie

  • Members
  • Pip
  • 2 posts
And as i said i'm completly new, how would i go about this. Got any tutorials that will lead me through the steps of creating one of those?

#4
G_Morgan

G_Morgan

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 537 posts
So you don't have a compiler set up?

First you will need to get hold of a compiler. I recommend MinGW personally.

SourceForge.net: Files

You'll want the Automated MinGW Installer (for the MinGW package there are lots of options, you can skip the extra languages like java - gcj and fortran - f77 but I'd install anything you aren't sure you don't need) and the first two MSYS packages. Install them.

Then you will need to set the windows path variable to these packages. This can be set by Control Panel->System->Advanced Tab and click Environment Variables. There are two sets of variables (system and user), in the system section modify the path variable. It should contain the path to your compiler and the msys distribution along with anything that was already in there, each separated by semi-colons. Mine reads

C:\Perl\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Java\jdk1.6.0_02\bin;C:\MinGW\bin;C:\msys\1.0\bin;C:\WINDOWS\system32\WindowsPowerShell\v1.0;C:\tcc\tcc;C:\Python25;C:\Program Files\Microsoft SDKs\Windows\v6.0\VC\Bin;C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin;C:\FPC\2.2.0\bin\i386-win32;C:\Program Files\Chez Scheme Version 7.3\bin\i3nt;C:\emacs-22.1\bin;C:\ghc\ghc-6.8.1\bin;C:\Program Files\PLT

Messy yes, welcome to windows development. Yours would probably look like this (copy the original into notepad first, just to be safe).

C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\MinGW\bin;C:\msys\1.0\bin

When you've done that you will be able to call your executable from any path in the CLI (i.e. you can call the C++ compiler with g++ rather than C:\MinGW\bin\g++, trust me this is worth the effort).

To get hold of a command prompt try "Win+R" then enter "cmd" into the run box.

Once you've done that or if you have any questions post here and I'll see what I can do.

#5
John

John

    Writes binary right handed and hex left handed

  • Moderators
  • 6,321 posts
I'd recommend downloading and installing DevC++