c++基础

2021/8/1 12:05:57

本文主要是介绍c++基础,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

1.::作用域运算符

::双冒号为全局运算符

#include <iostream>
using namespace std;

int atk = 200;

void Test()
{
    int atk = 100;
    cout << "Test内部:" << atk << endl;
    cout << "Test外部:" << ::atk << endl;
}

int main()
{
    Test();
    system("Pause");
    return EXIT_SUCCESS;
}

结果

 



这篇关于c++基础的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程