Control Panel
Your profile InformationPreferenceSignatureAvatar |
SocialFriends and foesMember list Groups |
Private messagesInboxPm sent |
Topic is being watched |
Search
Latest topics
Who is online?
In total there are 3 users online :: 0 Registered, 0 Hidden and 3 Guests None
Most users ever online was 92 on Sat Jul 24, 2021 11:38 pm
Basic C+++
Page 1 of 1
Basic C+++
o-k so C++ is the mix between binary and English. NOTE C++ looks nothing like a vb6 program it shows up in a DOS-box but hypothetically you could write a couple hundred lines of code to make it resemble somewhat a XP window but for now we move on. this is the best decompiler for C++ on the market thats free: http://downloads.phpnuke.org/en/downloa ... V-C%2B.htm
o-k so install it and open it.
now go to file- new-source code now you should have this
the big white ox is your template and that is where you will write your code.
Im sorry that every thing you have learned in vb6 is pretty much use less in c++ so get ready to be a lil confused.
NOTE: the " // " string is used for if you want to explain something so that people who look at your source can read along better. exp, //program that rapes your hard drive and your stocks
in devc++ that would be green
now to start you tell the computer where it gets its info from so you start like this
#include <cstdio>
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int nNumberofArgs, char* pszArgs[])
{
o-k see that " { " sign at the end, ya that sucker is crucial when separating chunks so for simple programs theres only one at the beginning and end, the end one i will talk about later. o-k so we have our base now we need to declare the functions this is a simple income finder, heres the source code and i will go over putting comments.
#include <cstdio> //this part is telling the computer what windows apps to include
#include <cstdlib> //
#include <iostream> //
using namespace std;
int main(int nNumberOfArgs, char* pszArgs[])
{
double hmw; //you see doule their that means a decimal
cout << "enter amount of hours: "; //cout means "see output" so what youl c in th box
cin >> hmw; //cin means what is typed in and >> means make so "cinput = hmw"
double income; //again a decimal, an integer is int long isa verry ig int but thts more
income = 6.55; //advanced. o-k so this means the string income = 6.55
double output; //decimal
output = income * hmw; //this makes the string output = income x hmw and the "x" has to be
//a " * " for multiplication
cout << "amount of money made: $"; //cout is what you see
cout << output << endl; //remember out put well that is now outputted with <<
//and "<< endl;" means endline
system("PAUSE"); //this is just the end
return 0;
} //remember to end with" } "
o-k these rates arnt up to date. (thank god)
also NOTE " ; " means end of section or like endsub but program keeps going
REMEMBER that << always goes with cout and >> always goes with cin
now this is error free i checked it so heres a virsion of it without the comments even tho comments dont hurt anything.
#include <cstdio>
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int nNumberOfArgs, char* pszArgs[])
{
double hmw;
cout << "enter amount of houres: ";
cin >> hmw;
double income;
income = 6.55;
double output;
output = income * hmw;
cout << "amount of money made: $";
cout << output << endl;
system("PAUSE");
return 0;
}
Copy and paste that or write it just as it is in the white box now compile with execute-compile or ctrl-F9 it will take a sec then it will say done and you can run it and it works! congrats you made your first c++ program its not much but this is a basic understanding if you want more then get C++ for dummies by Stephan Randy Davis.
also thank you Stephan for helping me with C++ and this tutorial was created originally by LuDy but since it looks allot like the first program in c++ for dummies i give Stephan most credit
this is your product
o-k so install it and open it.
now go to file- new-source code now you should have this
the big white ox is your template and that is where you will write your code.
Im sorry that every thing you have learned in vb6 is pretty much use less in c++ so get ready to be a lil confused.
NOTE: the " // " string is used for if you want to explain something so that people who look at your source can read along better. exp, //program that rapes your hard drive and your stocks
in devc++ that would be green
now to start you tell the computer where it gets its info from so you start like this
#include <cstdio>
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int nNumberofArgs, char* pszArgs[])
{
o-k see that " { " sign at the end, ya that sucker is crucial when separating chunks so for simple programs theres only one at the beginning and end, the end one i will talk about later. o-k so we have our base now we need to declare the functions this is a simple income finder, heres the source code and i will go over putting comments.
#include <cstdio> //this part is telling the computer what windows apps to include
#include <cstdlib> //
#include <iostream> //
using namespace std;
int main(int nNumberOfArgs, char* pszArgs[])
{
double hmw; //you see doule their that means a decimal
cout << "enter amount of hours: "; //cout means "see output" so what youl c in th box
cin >> hmw; //cin means what is typed in and >> means make so "cinput = hmw"
double income; //again a decimal, an integer is int long isa verry ig int but thts more
income = 6.55; //advanced. o-k so this means the string income = 6.55
double output; //decimal
output = income * hmw; //this makes the string output = income x hmw and the "x" has to be
//a " * " for multiplication
cout << "amount of money made: $"; //cout is what you see
cout << output << endl; //remember out put well that is now outputted with <<
//and "<< endl;" means endline
system("PAUSE"); //this is just the end
return 0;
} //remember to end with" } "
o-k these rates arnt up to date. (thank god)
also NOTE " ; " means end of section or like endsub but program keeps going
REMEMBER that << always goes with cout and >> always goes with cin
now this is error free i checked it so heres a virsion of it without the comments even tho comments dont hurt anything.
#include <cstdio>
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int nNumberOfArgs, char* pszArgs[])
{
double hmw;
cout << "enter amount of houres: ";
cin >> hmw;
double income;
income = 6.55;
double output;
output = income * hmw;
cout << "amount of money made: $";
cout << output << endl;
system("PAUSE");
return 0;
}
Copy and paste that or write it just as it is in the white box now compile with execute-compile or ctrl-F9 it will take a sec then it will say done and you can run it and it works! congrats you made your first c++ program its not much but this is a basic understanding if you want more then get C++ for dummies by Stephan Randy Davis.
also thank you Stephan for helping me with C++ and this tutorial was created originally by LuDy but since it looks allot like the first program in c++ for dummies i give Stephan most credit
this is your product
[Sex]Lan- Webmaster
- Posts : 20
Points : 553131
+Rep : 5
Join date : 2009-04-23
Location : Admin
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|
Sat Jun 27, 2009 12:01 pm by stick man
» goodbye acid
Sat Jun 27, 2009 12:00 pm by stick man
» I KNOW WHO TOOK MY ACC READ
Fri Jun 26, 2009 9:00 pm by stick man
» GARRYS MOD
Tue Jun 23, 2009 3:39 pm by stick man
» THE ULTIMATE SPAM OF THE ULTIMATE SPAM
Wed Jun 17, 2009 1:54 pm by stick man
» EVERYONE!!!!!!!
Wed Jun 17, 2009 1:53 pm by stick man
» Very Bad News
Thu Jun 04, 2009 7:23 pm by XxUberBitchxX
» Rin's Toolbar
Sun May 31, 2009 12:12 pm by XxUberBitchxX
» RE-LOCATION!
Sat May 30, 2009 10:31 am by XxUberBitchxX