std::

This is a discussion on std:: within the C++ Programming forums, part of the General Programming Boards category; I've reading some posts in this forum, and always found this funny looking code: "std::" . What is it? I've ...

  1. #1
    Registered User
    Join Date
    Nov 2003
    Posts
    66

    std::

    I've reading some posts in this forum, and always found this funny looking code: "std::" . What is it? I've read nothing about it in my C++ tutorial book (published 2003). I mean, wat does it do (it looks pointless to me...)? Where do i put it? etc. etc.
    An Unofficial Cristiano Ronaldo Website : Ronaldo 7

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    22,256
    Read up on C++ namespaces.

    Your C++ book author probably was careless, or drafted the book too early.

  3. #3
    Registered User
    Join Date
    Nov 2003
    Posts
    66
    i guess i was wrong, I just found something 'bout namspaces in the later secions. I was just wondering since none of the sample programs (I've seen sofar) used std::
    An Unofficial Cristiano Ronaldo Website : Ronaldo 7

  4. #4
    Registered User
    Join Date
    Jul 2003
    Posts
    450
    std is the standard template library and :: is the scope resolution operator so basicly std::function() means the function is part of the std namespace.

  5. #5
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    The sample programs so far probably had
    using namespace std;
    at the top.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  6. #6
    Veni Vidi Vice
    Join Date
    Aug 2001
    Posts
    343
    Correction
    std is the standard template library
    STL is the Stadard Template Library.

    std is the namespace where all c++ identifiers are defined. Namespaces are used to reduce name clashes among different libraries.
    01000111011011110110111101100100 011101000110100001101001011011100110011101110011 01100100011011110110111001110100 01100011011011110110110101100101 01100101011000010111100101110011 0110100101101110 01101100011010010110011001100101
    Good things donīt come easy in life!!!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Why std:: and not using namespace std?
    By swappo in forum C++ Programming
    Replies: 4
    Last Post: 07-03-2009, 04:10 PM
  2. std:: or namespace std
    By C-+ in forum C++ Programming
    Replies: 16
    Last Post: 12-04-2007, 12:30 PM
  3. Builder 5 v's bcc32.exe
    By sononix in forum C++ Programming
    Replies: 3
    Last Post: 08-17-2004, 11:17 AM
  4. need ; before using namespace std
    By wwfarch in forum C++ Programming
    Replies: 7
    Last Post: 05-11-2004, 11:42 PM
  5. Site tutorials
    By Aalmaron in forum C++ Programming
    Replies: 20
    Last Post: 01-06-2004, 02:38 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21