References are not objects; they do not necessarily occupy storage, although the compiler may allocate storage if it is necessary to implement the desired semantics (e.g. a non-static data member of reference type usually increases the size of the class by the amount necessary to store a memory address).
References are not objects; they do not necessarily occupy storage, although the compiler may allocate storage if it is necessary to implement the desired semantics (e.g. a non-static data member of reference type usually increases the size of the class by the amount necessary to store a memory address).
https://en.cppreference.com/w/cpp/language/reference
여기에 보면 컴파일러에 따라 필요하면 참조자를 위한 메모리를 할당할 수 있다고 나오네
ㅇㅎ 어차피 안바뀌는 주소값이니까 컴파일시에만 쓰고 실행타임에는 굳이 스택 할당을 안하는 거네. 근데 또 함수 매개변수로 보낼때나 이럴 때는 필요하니까 반드시 안하는 건 아닌가봄
근데 stackoverflow보니까 어셈블리 까보면 스택할당은 한다고 나옴ㅋㅋㅋ 다만 주소접근을 못할 뿐이지
https://stackoverflow.com/questions/1179937/how-does-a-c-reference-look-memory-wise
14번
그렇구만 좋은자료 ㄱㅅ
그냥 별명 붙여주는 거
니가 뭔가 오해를 하고있는거 같은데 니가쓴코드에서 레퍼런스b는 오브젝트가 아니야