someboddy Posted December 29, 2002 Share Posted December 29, 2002 This time, I am going to enter deeper to the programing world, so if you dont understand something, just ask. to program in C++, you will need the compiler. you can download it from here. Link to comment Share on other sites More sharing options...
Diso Posted December 29, 2002 Share Posted December 29, 2002 Good luck learning it dude!hope to see some great programs coming out of you I tried to learn C++ but the guy was like arab so I couldn't understand a word!!!! Link to comment Share on other sites More sharing options...
someboddy Posted December 29, 2002 Author Share Posted December 29, 2002 The first thing you need to know is how to use flowing diagrams. flowing diagrams are sample ways to show the program's guideline. flowing diagrams are written in normal language. for example, lets say we want towrite a program that get's a number, and multipile it by 2. so the flowing diagram goes like this. Start |read number to A |put A*2 in A |write A |End first, the program start's.than, the program take a number from the user, and put it on the variable A.than, the program change A to A*2/than, the program write A on the screen.than, the program end's.[/b] Link to comment Share on other sites More sharing options...
someboddy Posted December 29, 2002 Author Share Posted December 29, 2002 This flowing diagram can't actuly multipile's a number, but it can help us to create a program that can.Type this program to the C++ compiler: #include <iostream>using namespace std; void main(){ int A; cin >>A; A=A*2; cout <<A;} now run it (press Ctrl+F9), enter a number, and press Enter. you will return to the editor. In order to see the program results, run the program again. (if you have visual C++, press F5 to run the program) now I will explain the program: #include <iostream>using namespace std;this part tells the program to use the file "iostream". this file contain's the basic commands you will need. every command in C++(and many another programming languages) must end with ";", so don't forget to put it. void main(){this command start's the program's boddy. after the program finish's the "include" part, it goes to the "main" part, and does the command's there. this line doesn't end with ";", becouse it's a function (I will explain about function's in more advance lesson's), and it will only end when it will reach to "}". int A;this command creates a new variable from the type integer, and give it the name "A". when we will want to use that variable, we use the name A. integer's are complete numbers, so you can't put fraction's in it. cin >>A;the "cin" command take's informatio from the users, and put it in variables. before every variable you want to put data in, you type ">>". A=A*2;this command put's the data in the right side ("A*2" in this case), to the variable in the left side ("A"). cout <<A;the "cout" command print's data on the screen. the data can be variable, phrase, a number or text. before every data you want to print on the screen, you type "<<". }in order to end the "main" part (or any another block), you need "}". after the "}", you don't put ";". Link to comment Share on other sites More sharing options...
alexis Posted December 30, 2002 Share Posted December 30, 2002 Cool man thnx =D Link to comment Share on other sites More sharing options...
solidius23 Posted December 30, 2002 Share Posted December 30, 2002 lol i wish i had the time to learn c++ Link to comment Share on other sites More sharing options...
DeathDealer Posted January 3, 2003 Share Posted January 3, 2003 well someboddy good like trying to teach C++ its not really that simple now is it.i dont expect any from here to learn enough to make worthy program Link to comment Share on other sites More sharing options...
alexis Posted January 3, 2003 Share Posted January 3, 2003 thnx for the confidence dude Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now