Results 1 to 4 of 4

Thread: using namespace คืออะไร

  1. #1
    Administrator asylu3's Avatar
    Join Date
    Jun 2000
    Location
    Thailand
    Posts
    3,557


    using namespace คืออะไร

    [code]
    #include < iostream.h >
    void main()
    {

  2. #2
    Anonymous
    Guest


    Re: using namespace คืออะไร

    [ Using Directive ]
    เป็นการประกาศใช้ identifier ทุกตัวใน namespace นั้นๆ โดยที่ไม่ต้องระบุชื่อ namespace เช่น

    using namespace std; /* all identifiers in std namespace will be using without explicit qualifier */
    using namespace BlueBlood /* all identifiers in BlueBlood namespace will be using without explicit qualifier */

    [ Using Declaration ]
    คล้ายกับ using directive แต่ต่างกันตรงที่ using declaration จะเจาะจง identifier เป็นตัวๆไป เช่น

    using std::cout; /* identifier cout will be using without explicit qualifier */
    using BlueBlood::myVar; /* identifier myVar will be using without explicit qualifier */

  3. #3
    Junior Member
    Join Date
    Jun 2008
    Posts
    6


    using namespace BlueBlood /* all identifiers in BlueBlood namespace will be using without explicit qualifier */

    BlueBlood คือ identifiers หรืออะไรหรอคับ ไม่เข้าใจบรรทัดนี้

  4. #4


    กำลังศึกษาอยู่พอดีครับ กำลังงง ว่า code แรก เป็น iostream.h อันหลัง ไม่มี .h
    เพิ่มอีกนิดนึง ถ้าจะใช้คำสั่ง cout อย่างเดียวใช้ using std::cout; ก็ได้ครับ
    ผิดพลาดยังไงติเตือนได้ครับ มือใหม่หัดเขียน
    เพราะสังคมประเมินค่าที่จนรวย...คนจึงสร้างเปลือกสวยไว้สวมใส่....หากสังคมประเมินค่าที่ภายใน...คนจะสร้างแต่จิตใจที่ใฝ่ดี

Similar Threads

  1. XML คืออะไร
    By Error in forum Ethical Hacking for Padawan
    Replies: 1
    Last Post: 26-04-2009, 08:13 AM
  2. XML Namespace (.NET)
    By art1984 in forum แนะความรู้ด้าน Programming ต่างๆ
    Replies: 0
    Last Post: 16-02-2008, 02:42 PM
  3. blu-ray คืออะไร ?
    By ntspirit11 in forum บทความ คอมพิวเตอร์ ทัวไป
    Replies: 0
    Last Post: 17-11-2007, 06:27 PM
  4. RSS คืออะไร
    By Amine in forum Computer Tip & Trick / Tutorial
    Replies: 0
    Last Post: 25-10-2006, 09:58 PM
  5. IBM AS/400 คืออะไร
    By Anonymous in forum Operating System, Server and Networking
    Replies: 1
    Last Post: 12-07-2005, 05:10 AM

Members who have read this thread : 0

Actions : (View-Readers)

There are no names to display.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •