예)
???? 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.
텍스트 포맷에 대한 자세한 정보
<code>
<blockcode>
<apache>
<applescript>
<autoconf>
<awk>
<bash>
<c>
<cpp>
<css>
<diff>
<drupal5>
<drupal6>
<gdb>
<html>
<html5>
<java>
<javascript>
<ldif>
<lua>
<make>
<mysql>
<perl>
<perl6>
<php>
<pgsql>
<proftpd>
<python>
<reg>
<spec>
<ruby>
<foo>
[foo]
kkk를 return하면 당연히 kkk의 type을 적어주셔야 합니다.
kkk를 return하면 당연히 kkk의 type을 적어주셔야 합니다. map<int,int> aaa() {...} 가 되겠죠.
----------------------------------------
http://moim.at
http://mkhq.co.kr
[code:1]???? aaa(){ ...
이것보다..
이게 더 좋지 않을까요? 리턴값으로 맵을 넘기면 임시 객체 생성 때문에 map이 클 경우에는 비 효율적일것 같은데요..
-------------------------------------------------------------------------------
It's better to appear stupid and ask question than to be silent and remain stupid.
댓글 달기