Thread: Cant use std namespace, help required

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    The Richness... Richie T's Avatar
    Join Date
    Jan 2006
    Location
    Ireland
    Posts
    469
    Read this about <iostream.h> vs <iostream>

    http://www.devx.com/tips/Tip/14447

    I don't think that iostream.h was part of the standard, it was only used during the drafting
    process. Nevertheless, it is a bad idea to use it since it is very outdated.
    No No's:
    fflush (stdin); gets (); void main ();


    Goodies:
    Example of fgets (); The FAQ, C/C++ Reference


    My Gear:
    OS - Windows XP
    IDE - MS Visual C++ 2008 Express Edition


    ASCII stupid question, get a stupid ANSI

  2. #2
    Useless Apprentice ryan_germain's Avatar
    Join Date
    Jun 2004
    Posts
    76
    Quote Originally Posted by Richie T
    I don't think that iostream.h was part of the standard
    Anything with '.h' doesnt support namespaces. So when you add 'string.h' instead of just 'string', then std::string will not work.
    There is not the slightest indication that [nuclear energy] will ever be obtainable. It would mean that the atom would have to be shattered at will.

    -Albert Einstein, 1932

  3. #3
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >So when you add 'string.h' instead of just 'string', then std::string will not work.
    Correct, but not because of the std namespace. string.h is a C header with C string handling functions. It never has and likely never will host the string class.
    My best code is written with the delete key.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Thoughts about using namespace std?
    By dwks in forum C++ Programming
    Replies: 40
    Last Post: 09-25-2008, 05:14 PM
  2. using namespace std;
    By spank in forum C++ Programming
    Replies: 3
    Last Post: 01-20-2006, 06:28 AM
  3. namespace std
    By strobe9 in forum C++ Programming
    Replies: 5
    Last Post: 10-21-2003, 08:09 PM
  4. using namespace std, What does it do?
    By Ben K. in forum C++ Programming
    Replies: 1
    Last Post: 10-14-2001, 10:42 PM
  5. What is "using namespace std; "
    By Engel32 in forum C++ Programming
    Replies: 3
    Last Post: 09-28-2001, 07:23 AM