-
Feb 5th, 2009, 11:16 AM
#41
Addicted Member
Re: C/C++ - Hello World (very simple)
 Originally Posted by Maven
Interesting. Thanks for the link.
-
Feb 6th, 2009, 12:30 AM
#42
Hyperactive Member
Re: C/C++ - Hello World (very simple)
 Originally Posted by yitzle
Interesting. Thanks for the link.
For small applications, I do not think that endl or '\n' will matter much. When you begin writing intensive io applications, it will become very important to have tighter control on your buffering. If you was writing a web application with fastcgi, for example, then it becomes critical to control output. While a web application in C++ is far away from novice level, it's a good idea to start developing understanding of buffering.
Education is an admirable thing, but it is well to remember from time to time that nothing that is worth knowing can be taught. - Oscar Wilde
-
Mar 10th, 2009, 12:25 AM
#43
Banned
Re: C/C++ - Hello World (very simple)
 Originally Posted by BeholderOf
Code:
#include <iostream.h>
int main()
{
//This prints "Hello World" and <<endl makes a new line
cout<<"Hello World"<<endl;
return 0;
}
Explaination:
"#include <iostream.h>" - This is the header for cout/cin, in other words we include iostream.h so we can use the functions cout<<, and cin>>.
"int main()" - this is where our program actually starts.
"cout<<"Hello World"<<endl;" - This is what actually prints the text to the screen.
Just a simple example !
This is the basic of c++. Every one know about it...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|