C++ Codes Here!
- Cinjection
-
Cinjection
- Member since: Apr. 6, 2004
- Offline.
-
- Forum Stats
- Member
- Level 18
- Blank Slate
nice but can you answer my question (last post on page 9).
whoo im definetly not ready for Win32 yet lol.
- thoughtpolice
-
thoughtpolice
- Member since: Mar. 24, 2003
- Offline.
-
- Forum Stats
- Member
- Level 10
- Blank Slate
You ordinarely declare that shit like this:
char stuff[80];
But when using that with stuff like cin>> it makes your program exploitable via Stack Buffer Overflow, which are lame.
omg.
Playstation Network tag: muffin-noodle
the empty set
- Cinjection
-
Cinjection
- Member since: Apr. 6, 2004
- Offline.
-
- Forum Stats
- Member
- Level 18
- Blank Slate
At 3/7/05 08:50 PM, RegExp wrote: char stuff[80];
So, would that line declare a varialble that can hold up to 80 characters?
- thoughtpolice
-
thoughtpolice
- Member since: Mar. 24, 2003
- Offline.
-
- Forum Stats
- Member
- Level 10
- Blank Slate
At 3/8/05 08:44 PM, Love_Daddy wrote:At 3/7/05 08:50 PM, RegExp wrote: char stuff[80];So, would that line declare a varialble that can hold up to 80 characters?
Seventy-nine technically, because in C and C++ all strings are NULL terminated via \0 so the last space in the array is reserved.
omg.
Playstation Network tag: muffin-noodle
the empty set
- Cinjection
-
Cinjection
- Member since: Apr. 6, 2004
- Offline.
-
- Forum Stats
- Member
- Level 18
- Blank Slate
At 3/8/05 08:48 PM, RegExp wrote:At 3/8/05 08:44 PM, Love_Daddy wrote:Seventy-nine technically, because in C and C++ all strings are NULL terminated via \0 so the last space in the array is reserved.At 3/7/05 08:50 PM, RegExp wrote: char stuff[80];So, would that line declare a varialble that can hold up to 80 characters?
umm ok but what happens if you don't know how long the string will be. This is one of the reasons i like VB more C++.(In this case anyway.) Is there like a trim function like in VB or something. ARG, Dim blarg as string is so much easier.
- magpieOfDoom
-
magpieOfDoom
- Member since: Feb. 10, 2005
- Offline.
-
- Forum Stats
- Member
- Level 03
- Blank Slate
For all the wenches too lazy to make a c-string, there is a class in the standard library, std::string, which supports all of the nice operations (like infix plus for concat), and dynamically allocates data as needed. In short, you can do:
std::string bleh = "bleh";
std::string arr = "arr";
std::string final = bleh + arr;
printf("%s", final.c_str());
// Output is: "bleharr"
You have to use the c_str() method, when printing using a function like printf or cout, however, because printf and cout print out C-STRINGS, not std::strings. You also have to #include<string> (With no .h).
In general, though, if you allocate a nice big buffer, then it shouldn't be any problem in a game. If you THINK that your string is going to be, like, 90 characters long, make a 128 character string, and you should be fine. And always use multiples of powers of two, just because.
- Cinjection
-
Cinjection
- Member since: Apr. 6, 2004
- Offline.
-
- Forum Stats
- Member
- Level 18
- Blank Slate
hmmm that might be fine for a couple varablies but wouldn't that slow down your program if you have a bunch of those over declared varaibles. Or would it not really affect the ovaral program? Lol, sorry about all the questions people.
- thoughtpolice
-
thoughtpolice
- Member since: Mar. 24, 2003
- Offline.
-
- Forum Stats
- Member
- Level 10
- Blank Slate
At 3/8/05 08:51 PM, Love_Daddy wrote:At 3/8/05 08:48 PM, RegExp wrote:umm ok but what happens if you don't know how long the string will be. This is one of the reasons i like VB more C++.(In this case anyway.) Is there like a trim function like in VB or something. ARG, Dim blarg as string is so much easier.At 3/8/05 08:44 PM, Love_Daddy wrote:Seventy-nine technically, because in C and C++ all strings are NULL terminated via \0 so the last space in the array is reserved.At 3/7/05 08:50 PM, RegExp wrote: char stuff[80];So, would that line declare a varialble that can hold up to 80 characters?
If you don't know how long a string is going to be, you can either:
A. Make it longer, and just prevent the inevitable Stack Buffer Overflow that will occur unless initiating program Canary stacks or NX stacks.
B. Dynamically allocate enough memory for that, and open yourself up to Heap overflows, which aren't lame like Stack overflows.
omg.
Playstation Network tag: muffin-noodle
the empty set
- Cinjection
-
Cinjection
- Member since: Apr. 6, 2004
- Offline.
-
- Forum Stats
- Member
- Level 18
- Blank Slate
i tried plaing around with some dynamic allocating but it ddin't really work. My code was something along the lines of:
#include <iostream.h>
using namespace std;
int main()
int len;
cout<<"How many numbers will you sort?"<<endl; //for a lame # sorter btw
cin>>len;
int numbers[len];
//that doesn't work. Go figure. This is with a int but i supppose a char variable would be the same.
//.........
- thoughtpolice
-
thoughtpolice
- Member since: Mar. 24, 2003
- Offline.
-
- Forum Stats
- Member
- Level 10
- Blank Slate
Dynamic Memory Allocation is frusterating, in all languages, but it's worth learning. It's very easy once you figure it out.
Plus you figure out tons of new things like how to cause system faults all over the place because of DMA raddling out of control.
omg.
Playstation Network tag: muffin-noodle
the empty set
- Cinjection
-
Cinjection
- Member since: Apr. 6, 2004
- Offline.
-
- Forum Stats
- Member
- Level 18
- Blank Slate
Lol, dude your the biggest hacker on this forum since JesusCyborg.
- thoughtpolice
-
thoughtpolice
- Member since: Mar. 24, 2003
- Offline.
-
- Forum Stats
- Member
- Level 10
- Blank Slate
At 3/8/05 09:46 PM, Love_Daddy wrote: Lol, dude your the biggest hacker on this forum since JesusCyborg.
I try. But JC knows about eleventy-billion more things than I do.
Also, just for fun, I made this program based on something I read:
#include <stdio.h>
#include <malloc.h>
#define OVERFLOW 8
#define BUFSIZE 16
int main() {
char *buf1 = (char *)malloc(BUFSIZE),*buf2= (char *)malloc(BUFSIZE);
memset(buf2,'A',BUFSIZE-1);
printf("Before overflow: %s",buf2);
memset(buf1,'B',BUFSIZE+OVERFLOW);
printf("After overflow: %s",buf2);
getchar();
return 0;
}
If anybody can guess what it does, say so, if you have no idea what'll happen, stick it in your compiler and compile it (be sure it's a .c file, dunno 'bout you guys, but C programs compile much faster than C++ files for me)
omg.
Playstation Network tag: muffin-noodle
the empty set
- Cinjection
-
Cinjection
- Member since: Apr. 6, 2004
- Offline.
-
- Forum Stats
- Member
- Level 18
- Blank Slate
#include <iostream.h>
int main(){
char texts[12] = "Hello World";
int i;
for (i = 1; i <= 12; i++){
cout<<texts<<endl;
}
cin.get();
return 0;
}
lol, right when you think your making progress in a language you have to go back to "hello World". Well at least i can get text to work now lol. I'll try posting a dynamic allocating text thing in a couple of minutes if i can figure that out.
- Cinjection
-
Cinjection
- Member since: Apr. 6, 2004
- Offline.
-
- Forum Stats
- Member
- Level 18
- Blank Slate
lol well hear it is but it doesn't work.(but what else is new.) lol. Who wants to fix this......
#include <iostream.h>
int main(){
int nofchars;
cout<<"How long is your text, dude"<<endl;
cin>>nofchars;
nofchars = nofchars * 2;
char text[nofchars];
cout<<"enter some text now, please."<<endl;
cin>>text;
cout<<"You typed: "<<text<<endl;
cin.get();
return 0;
}
- thoughtpolice
-
thoughtpolice
- Member since: Mar. 24, 2003
- Offline.
-
- Forum Stats
- Member
- Level 10
- Blank Slate
That isn't dynamic memory allocation. Sorry, try again. :(
Or just look up how to do DMA in C++, because I only know how to do it in C.
omg.
Playstation Network tag: muffin-noodle
the empty set
- Cinjection
-
Cinjection
- Member since: Apr. 6, 2004
- Offline.
-
- Forum Stats
- Member
- Level 18
- Blank Slate
At 3/9/05 10:53 PM, RegExp wrote: That isn't dynamic memory allocation. Sorry, try again. :(
Or just look up how to do DMA in C++, because I only know how to do it in C.
ok lol i g2g sleep now but i might try something tommorow.(i put your prog on my site btw)(im not sure if you knew lol)(random)(must stop writing in brackets)(!)
- Cinjection
-
Cinjection
- Member since: Apr. 6, 2004
- Offline.
-
- Forum Stats
- Member
- Level 18
- Blank Slate
Well here is a little something i made just now. Its a Russian Roulette version of Black Jack. Im gonna upload it onto my site soon in case you want to download it and give it a wirl. Enjoy and feel free to correct any syntax or whatever you can find.176 lines of code just in case anyone cares.
#include <iostream.h>
#include <stdlib.h>
int russianroulettep(); //PLAYER ROULETTE
int russianroulettec(); //COMPUTER ROULETTE
int wincheck();
int death = 0;
int ccardv = rand() % 16 + 5;
int pcardv = rand() % 16 + 5;
int shotsl = 6;
// HIT CHECK
int main(){
int nextcard;
char hit;
cout<<"Welcome to SPS Russian Roulette Black Jack!"<<endl;
while(death == 0){
cout<<"Your total card value is: "<<pcardv<<endl;
cout<<"Do you want to hit?(y, n)"<<endl;
cin>>hit;
if ((hit == 'y')||(hit == 'Y')){
nextcard = rand() % 5;
pcardv += nextcard;
}
else if ((hit == 'n')||(hit == 'N')){
wincheck();
}
}
cin.get();
return 0;
}
//BEGIN WIN CHECK
int wincheck(){
cout<<"Player's total is: "<<pcardv<<endl;
cout<<"Computer's total is: "<<ccardv<<endl;
if (ccardv == 21){
cout<<"The computer gets blackjack. Sorry, you lose!"<<endl;
cout<<"Russian Roulette time!"<<endl;
russianroulettep();
}
else if (pcardv == 21){
cout<<"You get blackjack. You win!"<<endl;
cout<<"Russian Roulette time!"<<endl;
russianroulettec();
}
else if (pcardv == ccardv) {
cout<<"Sorry, computer pushes and wins!"<<endl;
cout<<"Russian Roulette time!"<<endl;
russianroulettep();
}
else if (pcardv > 21){
cout<<"You bust! Sorry you lose!"<<endl;
cout<<"Russian Roulette time!"<<endl;
russianroulettep();
}
else if (ccardv > 21){
cout<<"Computer busts! You win!"<<endl;
cout<<"Russian Roulette time!"<<endl;
russianroulettec();
}
else if (pcardv > ccardv){
cout<<"You have a higher card value. You win!"<<endl;
cout<<"Russian Roulette time!"<<endl;
russianroulettec();
}
else{
cout<<"Computer gets a higher card. You lose!"<<endl;
cout<<"Russian Roulette time!"<<endl;
russianroulettep();
}
return 0;
}
//END OF WIN CHECK
//PLAYER ROULETTE
int russianroulettep(){
int shotlimit = shotsl;
int shot = rand() % shotlimit;
int reqdeath = rand() % shotlimit;
cout<<"Ammo in gun left: "<<shotsl<<endl;
cout<<"Here's the shot..."<<endl;
if (shotsl == 1) {
cout<<"BLAM! Sorry you lose!"<<endl;
death = 1;
}
else if (shot == reqdeath){
cout<<"BLAM! Sorry you lose!"<<endl;
death = 1;
}
else if (shot != reqdeath){
cout<<"That was close, but you're still alive!"<<endl;
shotsl -= 1;
ccardv = rand() % 16 + 5;
pcardv = rand() % 16 + 5;
}
return shot;
}
//Computer ROULETTE
int russianroulettec(){
int shotlimit = shotsl;
int shot = rand() % shotlimit;
int reqdeath = rand() % shotlimit;
cout<<"Ammo in gun left: "<<shotsl<<endl;
cout<<"Here's the shot..."<<endl;
if (shotsl == 1) {
cout<<"BLAM! Computer loses!"<<endl;
death = 1;
}
else if (shot == reqdeath){
cout<<"BLAM! Computer loses!"<<endl;
death = 1;
}
else if (shot != reqdeath){
cout<<"That was close, but the computer is still alive!"<<endl;
shotsl -= 1;
ccardv = rand() % 16 + 5;
pcardv = rand() % 16 + 5;
}
return shot;
}
- magpieOfDoom
-
magpieOfDoom
- Member since: Feb. 10, 2005
- Offline.
-
- Forum Stats
- Member
- Level 03
- Blank Slate
In terms of Dynamic Memory Allocation for C++, you essentially just replace malloc with the new keyword. Just remember that you have to delete memory, and that when deleting arrays you have to do delete[].
char *PointerToMemory;
PointerToMemory = new char;
// Do something
delete PointerToMemory;
char *PointerToArray;
int LengthOfArrayThatCanChange = 100;
PointerToArray = new char[LengthOfArrayThatCanChange];
// Do something
delete[] PointerToArray;
- CronoMan
-
CronoMan
- Member since: Jul. 19, 2004
- Offline.
-
- Forum Stats
- Member
- Level 06
- Blank Slate
At 3/8/05 10:05 PM, RegExp wrote:At 3/8/05 09:46 PM, Love_Daddy wrote: Lol, dude your the biggest hacker on this forum since JesusCyborg.I try. But JC knows about eleventy-billion more things than I do.
Also, just for fun, I made this program based on something I read:
#include <stdio.h>
#include <malloc.h>
#define OVERFLOW 8
#define BUFSIZE 16
int main() {
char *buf1 = (char *)malloc(BUFSIZE),*buf2= (char *)malloc(BUFSIZE);
memset(buf2,'A',BUFSIZE-1);
printf("Before overflow: %s",buf2);
memset(buf1,'B',BUFSIZE+OVERFLOW);
printf("After overflow: %s",buf2);
getchar();
return 0;
}
If anybody can guess what it does, say so, if you have no idea what'll happen, stick it in your compiler and compile it (be sure it's a .c file, dunno 'bout you guys, but C programs compile much faster than C++ files for me)
You will most likely overwrite buf2 when memsetting buf1 to 'B', because buf2 preceedes buf1, so buf2 will be 'BBBBBBBBAAAAAAAA'.
C programs compile faster because it is easier to translate.
"no sound in ass"
- thoughtpolice
-
thoughtpolice
- Member since: Mar. 24, 2003
- Offline.
-
- Forum Stats
- Member
- Level 10
- Blank Slate
omg.
Playstation Network tag: muffin-noodle
the empty set
- Cinjection
-
Cinjection
- Member since: Apr. 6, 2004
- Offline.
-
- Forum Stats
- Member
- Level 18
- Blank Slate
#inlcude <iostream>
sturct stat{
int exp;
int level = 9;
};
using namespace std;
int main(){
int mystat;
stat mystat;
cout<<"What's Love_Daddy's EXP?"<<endl;
cin>>mystat.exp;
if (mystat.exp >= 1290) {
cout<<"OMG Love Daddy leveled up!!!!"<<endl;
mystat.level++;
cout<<"W00T, Go lv 10!!!"<<endl;
}
else {
cout<<"Nah He's under lv 10!"<<endl;
cout<<"Oh well keep depositing!"<<endl;
}
cin.get();
return 0;
//WOOT FOR ME!
}
- Unrealevil
-
Unrealevil
- Member since: Feb. 7, 2005
- Offline.
-
- Forum Stats
- Member
- Level 10
- Blank Slate
#include "stdafx.h"
#include "mousehook.h"
#include "nat$interface.h" //defines WM_TTI_GIVE_IT_UP
//because a class routine apparently can't be a callback, define global pointer to the class that a non-class
//callback can in turn call
LRESULT CALLBACK gCheckMousePosition(int nCode, WPARAM wParam, LPARAM lParam);
CMouseHook *pMouseHook = NULL;
//
//More shenanigans - these wrapper routines exist so that sp4gl doesn't have to know about the dll, and
//if the dll is nowhere to be found, for some reason, sp4gl can go on its merry way, just without the
//"keep-the-focus" feature
//
#ifdef _WINDLL
__declspec (dllexport)
#endif
CMouseHook *TTI_CreateMouseHook(CWnd *pWnd)
{
pMouseHook = new CMouseHook();
pMouseHook->Initialize(pWnd);
return pMouseHook;
}
#ifdef _WINDLL
__declspec (dllexport)
#endif
void TTI_DestroyMouseHook(CMouseHook *pHook)
{
delete pHook;
}
CMouseHook::CMouseHook()
{
m_pHookProcOld = NULL;
m_pHookee = NULL;
}
void CMouseHook::Initialize(CWnd *pWnd)
{
m_pHookee = pWnd; //keep track of the hooked window
int status;
HMODULE hMod = GetModuleHandle("sp4util.dll");
m_pHookProcOld = SetWindowsHookEx(WH_MOUSE_LL, (HOOKPROC)gCheckMousePosition, hMod, NULL);
if (m_pHookProcOld == NULL)
status = GetLastError();
}
CMouseHook::~CMouseHook()
{
if (m_pHookProcOld != NULL)
UnhookWindowsHookEx(m_pHookProcOld);
}
LRESULT CALLBACK gCheckMousePosition(int nCode, WPARAM wParam, LPARAM lParam)
{
return pMouseHook->CheckMousePosition(nCode, wParam, lParam);
}
#define click ((MOUSEHOOKSTRUCT *)lParam)->pt
//
//the hwnd member of the MOUSEHOOKSTRUCT is supposed to have the hwnd of the window we're clicking on,
//but it's always 0! So we're using click coordinates instead
//
LRESULT CMouseHook::CheckMousePosition(int nCode, WPARAM wParam, LPARAM lParam)
{
if (nCode >= 0 && nCode != HC_NOREMOVE && //user clicked somewhere
(wParam == WM_LBUTTONDOWN || wParam == WM_LBUTTONDBLCLK))
{
RECT rc;
m_pHookee->GetWindowRect(&rc); //in our window?
if (!(click.x >= rc.left && click.x <= rc.right && click.y >= rc.top && click.y <= rc.bottom))
::PostMessage(m_pHookee->m_hWnd, WM_TTI_GIVE_IT_UP, 0, 0);//no! so give up the focus
}
return CallNextHookEx(NULL, nCode, wParam, lParam);
} // CheckMousePosition
- magpieOfDoom
-
magpieOfDoom
- Member since: Feb. 10, 2005
- Offline.
-
- Forum Stats
- Member
- Level 03
- Blank Slate
Hooks are awsome :). On a related note, I once created a WH_GETMESSAGE hook (which monitors all system messages, sent from anywhere, to anywhere) in one of my apps. I didn't think that it was working though, so in a move of desparation, I made it so that it popped up a message box (That said "Arr") EVERY time a message was sent. You can imagine the chaos.
But -- NG BBS seriously needs a [code] tag or something along those lines, because, as code gets more complex, it gets exceedingly harder to read without formatting and syntax highlighting.
- Cinjection
-
Cinjection
- Member since: Apr. 6, 2004
- Offline.
-
- Forum Stats
- Member
- Level 18
- Blank Slate
At 3/17/05 07:48 PM, misterPhyrePhox wrote:
But -- NG BBS seriously needs a [code] tag or something along those lines, because, as code gets more complex, it gets exceedingly harder to read without formatting and syntax highlighting.
not a bad idea. I just always bold my code. It makes it a lot easier to read when thiers lots of code.
- thoughtpolice
-
thoughtpolice
- Member since: Mar. 24, 2003
- Offline.
-
- Forum Stats
- Member
- Level 10
- Blank Slate
At 3/17/05 07:48 PM, misterPhyrePhox wrote: Hooks are awsome :). On a related note, I once created a WH_GETMESSAGE hook (which monitors all system messages, sent from anywhere, to anywhere) in one of my apps. I didn't think that it was working though, so in a move of desparation, I made it so that it popped up a message box (That said "Arr") EVERY time a message was sent. You can imagine the chaos.
But -- NG BBS seriously needs a [code] tag or something along those lines, because, as code gets more complex, it gets exceedingly harder to read without formatting and syntax highlighting.
I still haven't figured out hooks. :(
Hell, I still haven't even figured out enough to code DLL files.
I'm so un-1337.
omg.
Playstation Network tag: muffin-noodle
the empty set
- dokeun
-
dokeun
- Member since: Aug. 31, 2002
- Offline.
-
- Forum Stats
- Member
- Level 15
- Blank Slate
I'm stuck on trying to take the square root of a floating decimal number. The way I tried to do it my compiler got mad if I didn't do it a certain way and even then it never worked.
- Cinjection
-
Cinjection
- Member since: Apr. 6, 2004
- Offline.
-
- Forum Stats
- Member
- Level 18
- Blank Slate
OK guys i need some help. I made a NG experaince calculator and i compiles but on runtime when it says "press enter to get your result" it will close. When i went to debug the thing i get an error ("unhandled exeption in expcalc.exe......Access violation") on the first line in the getdays() function. Well heres the code someone please help me out thanks.
#include <iostream.h>
int ustat;
int getdays();
int reqs[32] = {0, 1, 50, 100, 150, 200, 250, 300, 350, 400, 450, 1290, 2179, 3068, 3958, 4847, 5736, 6626, 7515, 8409, 9299, 10188, 11078, 11968, 12858, 13748, 14637, 15527, 16417, 17307, 18197, 19086 };
struct userstat{
public:
int exp;
char username[50];
int lv;
int lvwanted;
int daysn;
int expn;
};
int main(){
userstat ustat;
cout<<"Welcome to SPS NG experiance calcuator!"<<endl;
cout<<"This program was made by the NG user Love_Daddy!"<<endl;
cout<<"Note:That this program isn't effected by the exp needed increase by Human Target"<<endl;
cout<<"--------------------------------------------------------------------
------------"<<endl;
cout<<"Please enter your user name."<<endl;
cin>>ustat.username;
cout<<"Ok, "<<ustat.username<<", please enter you level."<<endl;
cin>>ustat.lv;
cout<<"Please enter you experiance points."<<endl;
cin>>ustat.exp;
cout<<"And last, please enter your wanted level."<<endl;
cin>>ustat.lvwanted;
cout<<"Thank you, "<<ustat.username<<"!"<<endl;
cout<<"Press enter to find how many days it will take you to reach lv"<<ustat.lvwanted<<"."<<endl;
cin.get();
getdays();
cout<<"It will take you "<<ustat.daysn<<"days to reach lv"<<ustat.lvwanted<<"!"<<endl;
cout<<"This program makes the assumption that you will deposit every day and it doesn't take into effect Human Targets power to change the required exp."<<endl;
cout<<"Thank you for using SPS Experiance calculator! Press enter to exit."<<endl;
cin.get();
return 0;
}
int getdays(){
userstat ustat;
ustat.expn = reqs[ustat.lvwanted] - ustat.exp; //error on this line
ustat.daysn = ustat.expn / 10;
return 0;
}
- magpieOfDoom
-
magpieOfDoom
- Member since: Feb. 10, 2005
- Offline.
-
- Forum Stats
- Member
- Level 03
- Blank Slate
@Love_Daddy: You have two DIFFERENT instances of userstat. One is the LOCAL variable ustat in the function main, and one is the LOCAL variable ustat (same name) in the function getdays. You need to make ustat a GLOBAL variable (or you could pass it to getdays, but whatever), by declaring it outside of the main function.
When you make the local variable ustat in getdays, you don't initialize it -- and so, the values in ustat are all screwed up. When you try to access reqs[ustat.lvwanted], ustat.lvwanted, remember, isn't initialized. Chances are, ustat.lvwanted is some random, random value like 11092843 (just as an example), so you try to access reqs[11092843], which is 11092843 * sizeof(userstats) bytes away from reqs, and it is probably some wierd system memory, which gives you an error when you try to access it.
I think I muddled up the explanation, though...
- Cinjection
-
Cinjection
- Member since: Apr. 6, 2004
- Offline.
-
- Forum Stats
- Member
- Level 18
- Blank Slate
thanx dude. I fixed the problem by removing the function because it really wasn't needed. I finished the code and im going to make a topic on it in a sec. You can download it and betatest it if you wish.
- Pandora-Tranquil
-
Pandora-Tranquil
- Member since: Feb. 22, 2005
- Offline.
-
- Forum Stats
- Member
- Level 02
- Blank Slate
maybe explaining WHAT the code means would help......
#include <iostream> a # is required by all include statements, the include statement will use the file in the brackets after it (that comes with the compiler) whereas iostream is for input and output basics like saying cout
using namespace std; not required in most compilers
int main(); this starts our program, all C++ programs need a starting function
{ a opening and closing brace is required for every function
cout << "Hello World"; cout basicallly prints to the screen some sort of data, you have to have opening and closing "'s if you want it to print something, and all lines of code usually end in ;
cin.get(); this makes it so when the user types something and hits enter the program closes, without it or system("pause"); you would see the window for about a millisecond
return 0; this basically ends the code
}
and thats a rundown ( a crappy rundown) of the basic hello world program
(i feel so smart) lol



