[TIL]ダベさん受講4日目


名前付きキーワードと識別子

  • 変数の名前、関数の名前、オブジェクト名->Identyfy
  • プログラムのアドレスをプログラマが認識できる名前に変換します.
  • 	int total;            가능	
    	int _orange;			가능	
    	int VALUE;				가능
    	int my variable name;	불가능	
    	int TotalCustomers;		가능
    	int void;				불가능 (예약어)
    	int numFruit;			가능
    	int 2some;				불가능 (숫자첫글자 x)	
    	int meters_of_pipe;		가능

    地域範囲

    #include <iostream>
    using namespace std;
    int main() 
    {
    
    	int x = 0;
    	
    	cout << x << " " << &x << endl;
    	{
    		//int x = 1;
    		x = 1;
    		cout << x << " " << &x << endl; //같은 영역
    	}
    
    	{
    		int x = 2;
    		cout << x << " " << &x << endl; // 다른 영역
    	}
    }
    
     #include <iostream>
    using namespace std;
    void doSomething(int x) 
    {
        x = 123;
        cout << x << endl; 
    
    }
    
    int main() 
    {
        int x = 0;
    
        cout << x << endl;  // 0
        doSomething(x);		//123
        cout << x << endl;	//0
    
    
        return 0;
    
    }