View previous topic :: View next topic |
Author |
Message |
lukechin Grandmaster Cheater Reputation: 0
Joined: 24 Jun 2006 Posts: 536 Location: in willy wonkas factory
|
Posted: Thu Apr 12, 2007 9:28 am Post subject: For Thoughs wanting to learn c++ |
|
|
This is for beginners here is my - blog http://codeguru-learningcpp.blogspot.com/
it justt covers the basics. I'll be adding more code over time.
P.S
this isnt for people like noz...etc
this is for people that ask how to program c++
theres something wrong with the html so just put
at the beginning of each program
#include <iostream>
_________________
hmm back once again....
Last edited by lukechin on Thu Apr 12, 2007 6:50 pm; edited 1 time in total |
|
Back to top |
|
|
appalsap Moderator Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Thu Apr 12, 2007 12:21 pm Post subject: |
|
|
you write
Code: |
#include // input output header file
#include // string header file
|
on top of every example program, and while this may be valid in dev-c++ (Because they include headers for you like iostream, stdio whether you like it or not) it is not valid elsewhere, please write the proper includes.
_________________
Last edited by appalsap on Thu Apr 12, 2007 6:53 pm; edited 1 time in total |
|
Back to top |
|
|
lukechin Grandmaster Cheater Reputation: 0
Joined: 24 Jun 2006 Posts: 536 Location: in willy wonkas factory
|
Posted: Thu Apr 12, 2007 6:43 pm Post subject: |
|
|
there somthing wrong i didnt relize but the blog reads <iostream> as html code caause of the <> ...
_________________
hmm back once again.... |
|
Back to top |
|
|
jongwee Moderator Reputation: 0
Joined: 28 Jun 2006 Posts: 1388 Location: Singapore
|
Posted: Fri Apr 13, 2007 6:45 am Post subject: |
|
|
Code: | #include
using std::cout;
using std::cin;
using std::endl; // if you havent seen this before it justs ends the line
int main()
{
for (int A = 1 ; A<= 30 ; A++)
{
cout << A << endl;
}
system("pause");
return 0;
} |
Why dont you just put a using namespace std;
instead of using std::cout;
using std::cin;
using std::endl;
_________________
|
|
Back to top |
|
|
appalsap Moderator Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Fri Apr 13, 2007 7:10 am Post subject: |
|
|
jongwee wrote: | Why dont you just put a using namespace std; |
because you shouldn't use namespaces in examples to beginning programmers who do not know what a namespace is.
_________________
|
|
Back to top |
|
|
pancit Newbie cheater Reputation: 0
Joined: 04 Apr 2007 Posts: 14
|
Posted: Fri Apr 13, 2007 8:13 am Post subject: |
|
|
im noobz
_________________
"I'm HACKING..."
_______________________________________
|
|
Back to top |
|
|
|