It appears you have not yet registered to Pirator. To register please click here...


Check out UnHideMe.net a SUPER FAST Proxy provided by Pirator! | FirePremiums.com Back Online!! Happy Holidays! Click Here | How-to: Remove Pirator Snow | Please vote to make Pirator #1 Click Here | Need offshore hosting from Pirator?? Pirator is now on a super fast dedicated server, offering offshore hosting Click Here | Learn more ways to earn FREE VIP Over here
Go Back   Piяator Community The Business Programming Tutorials
Home Register FAQ VB Image Host Members List Want VIP?? Arcade Search Today's Posts Mark Forums Read

Welcome to the Piяator Community forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Also check out UnHideMe.net a SUPER FAST Proxy provided by Pirator!

Reply
 
LinkBack Thread Tools Display Modes
Old 04-29-2008, 01:05 PM   #1 (permalink)
VIP Exclusive

 
Master's Avatar
 
Join Date: Dec 2007
Location: Idaho
Posts: 1,007
Thanks: 186
Thanked 254 Times in 128 Posts
Cool How to make your First C++ Program :D

Alright heres the CODE and i'll explane how this works.

Code:
# include <iostream>

using namespace std;

int main
{
   cout << "Hello World!" << endl;
   return 0;
}
First "#include <iostream>" when you run the program the compiler will look at the cpp header which includes iostream different components make you include different things. Like #include <winsock> etc... Then the "void main(void)" simply makes a function that is kept in the curly braces the function is called main with void parameters Simple Now the cool part. "cout >> "Hello World!" << endl;" This simply puts in some output in the form of "Hello Worl" and endl; put's in a line called: Press any key to continue...

And that is how you make a hello world program I and I hope you understood most of that lol . But I would sudjest getting a book on C++.

Sams Teach Yourself C++ in 21 days (Fifth Edition)
this book is what I first used to learn, its not all that hard, and I would greatly recomend this book to everybody . Enjoy!

-master
__________________

Last edited by Master : 04-29-2008 at 11:23 PM.
  Reply With Quote
The Following 3 Users Say Thank You to Master For This Useful Post:
emerica (04-29-2008), Jamie T (04-29-2008), s0larflar3 (07-16-2008)

Sponsored Links
Your Ad Here
Old 04-29-2008, 06:24 PM   #2 (permalink)
your local hero

 
emerica's Avatar
 
Join Date: Feb 2008
Location: England
Posts: 1,054
Thanks: 133
Thanked 157 Times in 105 Posts
hopefully this will get me started with basic c++, i really want to learn
__________________
Use WinRAR or WinUHA for my Downloads!




check out my work HERE


All of my uploads are MYown. If a link is dead,
Please let me know and ill sort it out!
Also remember to say thanks
  Reply With Quote
Old 04-29-2008, 06:30 PM   #3 (permalink)
Banned

 
Join Date: Jul 2007
Location: The Netherlands
Posts: 119
Thanks: 53
Thanked 86 Times in 71 Posts
still have to do my first C++ so I'll be looking into this
  Reply With Quote
Old 04-29-2008, 06:47 PM   #4 (permalink)
VIP Exclusive

 
slayerhk47's Avatar
 
Join Date: Dec 2007
Location: pirator.net
Posts: 218
Thanks: 37
Thanked 41 Times in 27 Posts
Quote:
Originally Posted by Master View Post
Alright heres the CODE and i'll explane how this works.

Code:
# include <iostream>

int main
{
   cout >> "Hello World!" << endl;
}
Hmmm. Dont you need:
Code:
using namespace std;
under the <iostream>? Thats what we use.
__________________



<---New pirators read this!


Check out my band yo!
  Reply With Quote
Old 04-29-2008, 07:09 PM   #5 (permalink)
Banned

 
Binary_Ninja's Avatar
 
Join Date: Oct 2007
Posts: 0
Thanks: 224
Thanked 358 Times in 172 Posts
Yes, you do need to add,
Code:
 using namespace std;
, or put
Code:
std::cout<<
etc.. and when you run this program you wont be able to see the "Hello World" unless you hold the Execution window open by using
Code:
cin.get();
. And dont forget you have to Renurn a value to the main function like 0, to indicate all went well lol..

Code:
 # include <iostream>
using namespace std;
int main
{
   cout << "Hello World!" << endl;
   cin.get();
   return 0;
}
That would be the correct code

Last edited by Binary_Ninja : 04-29-2008 at 11:21 PM.
  Reply With Quote
Old 04-29-2008, 07:32 PM   #6 (permalink)
Leecher

 
HackM4T's Avatar
 
Join Date: Sep 2007
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Thx man i`m practice that...
__________________
" Everything should be made as simple as possible, but not simpler" A. Einstein
  Reply With Quote
Old 04-29-2008, 10:36 PM   #7 (permalink)
VIP Exclusive

 
Master's Avatar
 
Join Date: Dec 2007
Location: Idaho
Posts: 1,007
Thanks: 186
Thanked 254 Times in 128 Posts
Quote:
Originally Posted by Binary_Ninja View Post
Yes, you do need to add,
Code:
 using namespace std;
, or put
Code:
std::cout<<
etc.. and when you run this program you wont be able to see the "Hello World" unless you hold the Execution window open by using
Code:
cin.get();
. And dont forget you have to Renurn a value to the main function like 0, to indicate all went well lol..

Code:
 # include <iostream>
using namespace std;
int main
{
   cout >> "Hello World!" << endl;
   cin.get();
   return 0;
}
That would be the correct code
whoa, i can't believe I made those simple beginner mistakes... lol I havn't coded in a little while... Thanks
__________________
  Reply With Quote
Old 04-29-2008, 11:30 PM   #8 (permalink)
Banned

 
Binary_Ninja's Avatar
 
Join Date: Oct 2007
Posts: 0
Thanks: 224
Thanked 358 Times in 172 Posts
Code:
#include "stdafx.h"

using namespace System;

int main(array<System::String ^> ^args)
{
    Console::WriteLine(L"Hello World");
    return 0;
}
The win32 console version.
  Reply With Quote
Old 04-30-2008, 07:33 AM   #9 (permalink)
Leecher

 
Join Date: Apr 2008
Posts: 5
Thanks: 0
Thanked 1 Time in 1 Post
I was learning javascript but got bored so this might help...
  Reply With Quote
Old 04-30-2008, 12:48 PM   #10 (permalink)
VIP Exclusive

 
Master's Avatar
 
Join Date: Dec 2007
Location: Idaho
Posts: 1,007
Thanks: 186
Thanked 254 Times in 128 Posts
Quote:
Originally Posted by thez View Post
I was learning javascript but got bored so this might help...
if you get board with a language as simple as javascipt I wouldn't sudjest learning C++ being that its so much bigger and complex. Though, if you want to try go ahead.
__________________
  Reply With Quote
Old 04-30-2008, 03:15 PM
Bizrox
This message has been deleted by han solo. Reason: Spam and/or unwanted content
Old 05-02-2008, 08:21 PM
mahmoomabarcha
This message has been deleted by Binary_Ninja. Reason: spam
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


ePirate | PiratorPorn | DownloadForum | VirtualFreedom | AdultBB | WarezRaid | Katz | Forbishare | PhazeDDL

FirePremiums

Reign On Top

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
All times are GMT -5. The time now is 04:24 PM.