c++ learning 5 -- namespace

#include <iostream>
using namespace std;

// Namespace
 // Function distinguishes variables or functions with the same name, etc.

#if 0

Instructions
    1 , using  namespace name
     2 , name::variable name\function::scope operator
     3 , using name::member specifies to open a specific member For example: using std::cout

#endif

namespace stu
{
    void sort()
    {
        cout << "stu" << endl;
    }
}
void sort()
{
    cout << "none namespace!" << endl;
}

intmain ()
{
    stu::sort();
    sort();
    system("pause");
    return 0;
}

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324903051&siteId=291194637