CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2009
    Posts
    12

    Return a STL map

    Hi guys,

    Suppose I have a map

    map<CString,__int64> infoMap;

    and its filled by a fn

    returnType GetInfo()
    {
    ...
    ...
    ...

    return infoMap;

    }


    what should be the return type ?
    Thanks a lot.

  2. #2
    Join Date
    Aug 2000
    Location
    West Virginia
    Posts
    7,725

    Re: Return a STL map

    Probably one of the following:

    Code:
    map<CString,__int64>
    
    //
    
    map<CString,__int64> &
    
    //
    
    const map<CString,__int64> &

    hard to say without more information.

  3. #3
    Join Date
    Jun 2009
    Posts
    12

    Re: Return a STL map

    what more information may I provide you ? Please ask me.

  4. #4
    Join Date
    Jun 2009
    Posts
    12

    Re: Return a STL map

    I got it to work, thanks anyway !! the 1st one did the trick...

  5. #5
    Join Date
    Jan 2003
    Location
    Timisoara, Romania
    Posts
    306

    Re: Return a STL map

    The return value might be Philip recommendations, even CString, __int64 type or any other type that you want to return from your function.

    It depends on what are you doing in this function and what you expected to get when you are calling it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured