예)
???? aaa(){ ... map <int , int> kkk; ... return kkk; }
일때 어떻게 ???? 부분에 적어야 하나요?
ㅠㅠ 대충 c++하다보니 이런것도 모르겠어요 ㅠㅠ
kkk를 return하면 당연히 kkk의 type을 적어주셔야 합니다. map<int,int> aaa() {...} 가 되겠죠.
----------------------------------------http://moim.athttp://mkhq.co.kr
이것보다..
void aaa(map <int , int> &kkk){ kkk.insert(...); ... return kkk; }
이게 더 좋지 않을까요? 리턴값으로 맵을 넘기면 임시 객체 생성 때문에 map이 클 경우에는 비 효율적일것 같은데요..
------------------------------------------------------------------------------- It's better to appear stupid and ask question than to be silent and remain stupid.
kkk를 return하면 당연히 kkk의 type을 적어주셔야 합니다.
kkk를 return하면 당연히 kkk의 type을 적어주셔야 합니다. map<int,int> aaa() {...} 가 되겠죠.
----------------------------------------
http://moim.at
http://mkhq.co.kr
[code:1]???? aaa(){ ...
???? aaa(){ ... map <int , int> kkk; ... return kkk; }이것보다..
void aaa(map <int , int> &kkk){ kkk.insert(...); ... return kkk; }이게 더 좋지 않을까요? 리턴값으로 맵을 넘기면 임시 객체 생성 때문에 map이 클 경우에는 비 효율적일것 같은데요..
-------------------------------------------------------------------------------
It's better to appear stupid and ask question than to be silent and remain stupid.