| Simple programs#1& how it works/what makes it up | |
|
|
Author | Message |
---|
Zachy Addicted Cookie
Posts : 322 Points : 5745 Join date : 2009-07-12 Age : 32 Location : USA
| Subject: Simple programs#1& how it works/what makes it up Wed Jul 29, 2009 5:33 pm | |
| - Code:
-
/* Multi-line comment */
//single line comment
#include<stdio.h> /*this allows the script to call a...library? telling the computer how to interperate the commands*/ #include<iostream.h>
using namespace std; int main() { printf("Hello world"); cout << "Hello world!"; return 0; }
int main() starts the new function main. main is ALWAYS executed FIRST. Both cout&printf are commands to print text either in console or on screen. printf works with stdio.h cout works with iostream.h iostream.h contains basic commands. Yeah... (done in 2 minutes) | |
|
| |
[Admin]1337 Co-Owner~[Admin]1337
Posts : 1101 Points : 2147488530 Join date : 2009-07-07
| Subject: Re: Simple programs#1& how it works/what makes it up Wed Jul 29, 2009 6:02 pm | |
| U can just use - Code:
-
#include <iostream> using namespace std; int main() { cout << "Hello World!"; system("PAUSE"); return 0; }
| |
|
| |
Zachy Addicted Cookie
Posts : 322 Points : 5745 Join date : 2009-07-12 Age : 32 Location : USA
| Subject: Re: Simple programs#1& how it works/what makes it up Wed Jul 29, 2009 6:48 pm | |
| Thats what i did... you just changed 3 things...
changed iostream.h to iostream, added pause, and deleted the other printf.
its a guide, i was just showing 2 simple ways... | |
|
| |
Admin #1 loler: [Owner]Henry
Posts : 1708 Points : 7145 Join date : 2009-07-04 Age : 28 Location : Southern California
| Subject: Re: Simple programs#1& how it works/what makes it up Sat Aug 01, 2009 4:38 pm | |
| | |
|
| |
[Admin]1337 Co-Owner~[Admin]1337
Posts : 1101 Points : 2147488530 Join date : 2009-07-07
| Subject: Re: Simple programs#1& how it works/what makes it up Sat Aug 01, 2009 7:38 pm | |
| - Admin wrote:
- ok, what is this?
Code for program -_- | |
|
| |
Zachy Addicted Cookie
Posts : 322 Points : 5745 Join date : 2009-07-12 Age : 32 Location : USA
| Subject: Re: Simple programs#1& how it works/what makes it up Sun Aug 02, 2009 4:02 am | |
| lol.... Yes. its a code. for a program... | |
|
| |
[Admin]1337 Co-Owner~[Admin]1337
Posts : 1101 Points : 2147488530 Join date : 2009-07-07
| Subject: Re: Simple programs#1& how it works/what makes it up Sun Aug 02, 2009 10:41 am | |
| Once executed itll say "Hello World!" | |
|
| |
Zachy Addicted Cookie
Posts : 322 Points : 5745 Join date : 2009-07-12 Age : 32 Location : USA
| Subject: Re: Simple programs#1& how it works/what makes it up Mon Aug 03, 2009 9:58 am | |
| | |
|
| |
[Admin]1337 Co-Owner~[Admin]1337
Posts : 1101 Points : 2147488530 Join date : 2009-07-07
| Subject: Re: Simple programs#1& how it works/what makes it up Mon Aug 03, 2009 10:16 am | |
| | |
|
| |
Zachy Addicted Cookie
Posts : 322 Points : 5745 Join date : 2009-07-12 Age : 32 Location : USA
| Subject: Re: Simple programs#1& how it works/what makes it up Tue Aug 04, 2009 1:26 pm | |
| | |
|
| |
[Admin]1337 Co-Owner~[Admin]1337
Posts : 1101 Points : 2147488530 Join date : 2009-07-07
| Subject: Re: Simple programs#1& how it works/what makes it up Tue Aug 04, 2009 2:03 pm | |
| | |
|
| |
Zachy Addicted Cookie
Posts : 322 Points : 5745 Join date : 2009-07-12 Age : 32 Location : USA
| Subject: Re: Simple programs#1& how it works/what makes it up Tue Aug 04, 2009 5:27 pm | |
| o_o, 2 posts till 200~(one after this one) | |
|
| |
[Admin]1337 Co-Owner~[Admin]1337
Posts : 1101 Points : 2147488530 Join date : 2009-07-07
| Subject: Re: Simple programs#1& how it works/what makes it up Tue Aug 04, 2009 6:37 pm | |
| | |
|
| |
Zachy Addicted Cookie
Posts : 322 Points : 5745 Join date : 2009-07-12 Age : 32 Location : USA
| Subject: Re: Simple programs#1& how it works/what makes it up Wed Aug 05, 2009 5:13 am | |
| | |
|
| |
Admin #1 loler: [Owner]Henry
Posts : 1708 Points : 7145 Join date : 2009-07-04 Age : 28 Location : Southern California
| Subject: Re: Simple programs#1& how it works/what makes it up Sat Aug 08, 2009 6:56 pm | |
| im confused with tech stuff | |
|
| |
Zachy Addicted Cookie
Posts : 322 Points : 5745 Join date : 2009-07-12 Age : 32 Location : USA
| Subject: Re: Simple programs#1& how it works/what makes it up Sun Aug 09, 2009 12:52 pm | |
| | |
|
| |
Sponsored content
| Subject: Re: Simple programs#1& how it works/what makes it up | |
| |
|
| |
| Simple programs#1& how it works/what makes it up | |
|