473,385 Members | 1,445 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Retrive map elements with out sorting

I am using "map<string, string> mapVal" to store the user data.
By nature once values are inserted into the map, while retrieving the elemets will be in sorted order.
But my out put should be, the same order should be followed while retieving the elements as of inserting.

ex:
mapVal["bom"]="Val1";
mapVal["Air"]="cont";

once we iterate "mapVal" the output will be in ordered manner as

1. Air = cont
2. bom = Val1

my result should get val as
1. bom = Val1
2. Air = cont

is there any way i can get the ordered output from the map, or any other alternative.

Thanks.
Jan 30 '08 #1
1 1387
weaknessforcats
9,208 Expert Mod 8TB
Then use a vector containing pairs of strings. It implements an array so you can use the array index to retreive your data.

If you use the push-back() method, your pairs will be in the vector in the ordered they were entered.
Jan 30 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Zhang Weiwu | last post by:
This is really very stange. I have a form like this: <form id="form_A"> xxxx </form> This form is on one page in a page of a web application, it is the only form on that page. on the end of...
1
by: Xavier Pacheco | last post by:
Sorting nodes/rows given the following xml: <top> <someelement/> <someotherelement/> <item> <sequence>5</sequence> <subitems>
2
by: Terry | last post by:
Any .dll or COM+ for .Net can help me retrive data from a Access file? The table contain several columns and the last one is a container which I store Article; because each article is a little bit...
4
by: R | last post by:
Hi All, I have problem with sorting nodes I want sort them by columns c1, c2 also I have node <root><sort ActiveField="c0"/></root> ActiveField attribute is set by user. I'm sorting 'row'...
1
by: daldridge | last post by:
I have a unique-elements/sorting question (who doesn't?), but haven't yet been able to get appropriate template/select/for-each processing working. I don't fully grok the Muenchian technique yet...
8
by: asenthil | last post by:
Hai, i'm having a string in a specific field of a database... now i want to retrive that string from the database and i have to write that string into a xml file.... retriving is not a...
0
nehashri
by: nehashri | last post by:
hi, I need one help regarding Asp with MsAccess database. Problem. ======== i want to retrive stored image from the MSAccess database using asp.
23
nehashri
by: nehashri | last post by:
hi i am designing a database using Ms Access and ASP. i have 3 tables in access namely 'PERSONAL', other as 'POLICY' and 3rd one is named as 'STAFF'. in the contact table i have ID, Name, Children...
1
by: amritranjan | last post by:
How to retrive image file from MS access database and display this in another JSPpage -------------------------------------------------------------------------------- This is my Jsp code for...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.