Click here to Skip to main content
15,895,740 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I'm getting an error on this code....do I need to add something to get the third line to return file size?

C++
for(std::map<std::wstring,>::const_iterator it = map.begin(); 
        it != map.end(); ++it) 
    { 
        MessageBoxW(NULL,it->first.c_str(),L"File Name",MB_OK); 
        MessageBoxW(NULL,it->second.sLastAccessTime.c_str(),L"File Date",MB_OK);
	MessageBoxW(NULL,it->third.nFileSize.c_str(),L"File Size",MB_OK); 
    } 


The Error: 1 IntelliSense: class "std::pair" has no member "third"
Posted

1 solution

std::pair is a template with two members, first and second, there is no "third" member.

Assuming that nFileSize is a std::string second.nFileSize.c_str() will probably do what you expect.

Best regards
Espen Harlinn
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900