question for looping through this map structure and text files
e.g.. this is how i insert data into my map..
typedef map<string, string> MapFunction;
how can i then loop through the dbase map and write the entries to c:\dbase.txt?
i know for text writing, we use #include <iostream>, but im unsure as to how we loop through the map, and get each entry in the map and write it to the text file, so after the loop is done, the dbase.txt should be like this
I would much appreciate it if someone can help me
To use text files you needThe text file will look like
Helen Femal67 Mark niceguy Rosie Helen_sis
You want to read this article about maps:
In short, you have to use an iterator initialized to MapFunction::begin(), and then increment it until you reach end(). Then use the *it->first, *it->second to access the key and the associated value (i.e., the first and second strings) in each iteration.
Regarding file I/O, see http://gethelp.devx.com/techtips/cpp.../10min0601.asp
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL