Jul 24, 2008

Learn C/c++ From The Beginning - C/c++ tutorials for beginners and expert at the same time

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > C/C++ Programming
Pages: 1, 2

free web hosting

Learn C/c++ From The Beginning - C/c++ tutorials for beginners and expert at the same time

osknockout
Sure, no problem. In your code, you posted "cout <<" something without declaring the std (standard) namespace. Basically, you referred to something that doesn't exist all by itself in the C++ language, but rather in a standard group of functions. std - the namespace - is defined in iostream, cout is defined as part of std. So for a program, people would normally write std::cout. Now, if you wanted to write just cout, you would write "using std" before going "cout" something to tell the compiler that if something's not in the list of definitions, look in the std namespace.

Normally, just posting "cout" something is fine because some compilers use std as default , but at least a few ANSI-strict compilers will have problems with that - and a lot of older compilers will have problems with that too. Also, supposing that you made another namespace - say foo for example - and you declared using foo before you declared "cout". Then instead of referring to std::cout, you'd be referring to foo:cout, which is probably not what you want. ~ It's just bad for portability and some style reasons.

Tell me if that makes sense.

 

 

 


Reply

Csshih
Thanks, that made sense smile.gif
I guess that Microsoft Visual C++ 6 uses std as default.

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Pages: 1, 2
Similar Topics

Keywords : learn, c, c, beginning, c, c, tutorials, beginners, expert, time

  1. C Programming Video Tutorials
    This is for all the memebers out there looking or need some mroe help (2)
  2. Beginners Guide To C/c++ Programming?
    (2)
    ok so I was wondering if anyone knows where I can find a good, c/c++ dummy friendly guide? my main
    reason for want to learn it so that I can make .cab files that do registry edits for ppc. I know
    this should be easy to do, Any help would be greatly appreciated. Thx in advanced, Mike....
  3. Dos Game Programming In C For Beginners
    (1)
    There are a number of tutorials available for the intermediate game programmer, but there are very
    few good tutorials for beginners who have never drawn a pixel on the screen. A quick search on the
    net reveals hundreds of sites devoted to 3D, polygons, texture- mapping and other advance topics,
    but the beginner has no where to get started. This tutorial is for C programmers who want to get an
    introduction to game programming. find this tutorial at Dos Game Programming in C for Beginners
    ....
  4. Beginning C++ Programing!
    (0)
    I just started C++ programming but I understand it a lot! You should use the free bloodshed C++
    Program just search google for it. So the tut: Here is the code you will be making CODE // C++
    Tutorial // First C++ Script #include using namespace std; int main() { cout int nothing;
    cin >> nothing; return 0; } So lets say what this means! CODE // C++ Tutorial // First C++
    Script This is a comment line. This when compiled will NOT get put into the programming. This is
    just for humans who look at the script. I will use these a lot in further tutorials. ....
  5. Returning Back To The Beginning Of An If Statement
    (3)
    I have a bit of code. I am sooo close to figuring out. The only thing I need it to do, is return
    back to the beginning of the if statement after the new input is entered to determine of the new
    input meets the requirements. Here is my code: Code: CODE int input() //request input
    from user { int size = 0, size_even = 0; cout << " Please enter an odd number between
    3 and 25: "; cin >> size;   size_even = size % 2;     // if statement to
    determine if the number is between 3 and 25 if((size >= 3) && (siz....

    1. Looking for learn, c, c, beginning, c, c, tutorials, beginners, expert, time

Searching Video's for learn, c, c, beginning, c, c, tutorials, beginners, expert, time
advertisement



Learn C/c++ From The Beginning - C/c++ tutorials for beginners and expert at the same time



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE