There is no truly easy method. It's a heavily structured language and if you screw up it fails to work for you.
The top area is where you declare lots of things, like the libraries you will be using.
Some libaries are common. Others are specific.
C is considered a "portable" language. By this it is meant that you can write a core program and then compile that program to use on Macintosh, PC Windows, Unix or Linux or even a hand held device.
The top of hte program is where you put all these libraries which are nothing but little tool kits you call on to do fancy stuff.
There are called "includes" because you are including them.
You also declare some variables at the top of the program.
A lot of C++ has gotten easer if you are working in OJECT C, such as Visual C++
This lets you DRAG and DROP objects.
An object is this text box I'm writing in, complete with scroll bar at the right.
You used to have to build these yourself, but now they come pre-written, only it makes the langauge less portable because Visual C++ is only available for Mac and PC.
C++ was designed to be a lot like low level languages (assembler) which are designed for a GIVEN chip (An Intel Chip, an AMD chip, etc.)
There there are no fancy things in C++
YOu have to build things using several different items.
C++ also requires clear starting and ending points defined by brackets
{
This is the start;
Below is the end;
}
YOu also have to terminate with a semi colon.
Programming in C++ is like doing an outline. Think of desiging things that way
I. Top definition area
1. First point
A. Sub Topic
B. Sub Topic
C. Sub topic
2. Next Point
3. Next Point
A. Sub Topic
B. Sub Top
II. Next area of the program.
Programming is also simplification.
This is probably why they want you to have Algebra II first.
You do procedures for things, just like in math, except once you do the producdures and get the results you look at your algorithm and say what can I combine to lower the amount of lines used.
Let's take a math equation:
{
d=sqr(-n*n+1);
e=n/d;
f=atn(e);
a=f+1.5708;
}
But it takes less steps to do the math inside out in a single line, like this
{
a=atn(n/sqr(-n*n+1))+1.5708;
}
Math in parenthese is done from the inner most outward.
n would be passed to the equation from elsewhere. Maybe it's one of the things declared at the top area.
Don't worry about all these things.
You actually design them.
You can write out variables like this
firstangle
secondangle
thirdangle
but in a BIG program where you have to writes these 50 times, it get tireing so you call them
a
b
c
The big killer is going to be learning about PASSING BY ADDRESS
C++ passes values by the ADDRESS in memory not by the value.
the value of "n" for example is found or store by putting that value into an area of memroy (address) and then calling it back
This part's a killer in C. You have to really learn the rules and they are different for letters, integers and real numbers.
Get it wrong and you get the wrong value back or worse the program crashes.
The first thing you debug for is passing values wrong!
That's usually the first place things go wrong.
Pass a value wrong and you might dip into SYSTEM memory and crash windows out and your whole comptuer reboots.
This, now, explains the infamous BLUE SCREEN
The PROGRAM generated a FAULT at 34EE4A0FFF
Bang, you're locked up!
What it's telling you is that at some memory address some value that shouldn't have gone there went there
This one is great:
http://www.cplusplus.com/doc/tutorial/
These are references
http://www.fz-juelich.de/zam/cv/lang/cplusplus/cplusplus_ext
http://www.cyberdiem.com/vin/learn.html