473,396 Members | 1,773 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,396 software developers and data experts.

std::maps

Can I have maps with following properties?
Key= A character strings...
Value=A structure... Members of structure will be two character
strings....

If yes how to do that?Can anyone tell me the detail syntax of that...

How to compare a character string with one of the value in that
structure????????

Oct 27 '06 #1
8 1872
Anamika wrote:
Can I have maps with following properties?
Key= A character strings...
Value=A structure... Members of structure will be two character
strings....

If yes how to do that?Can anyone tell me the detail syntax of that...

How to compare a character string with one of the value in that
structure????????
Yes you can, but better is having the key be a std::string.

i.e.:

std::map<std::string, my_structmy_map;
Oct 27 '06 #2

"Anamika" <sh*************@gmail.comwrote in message
news:11**********************@k70g2000cwa.googlegr oups.com...

Question 1:
Can I have maps with following properties?
Key= A character strings...
Value=A structure... Members of structure will be two character
strings....

If yes how to do that?Can anyone tell me the detail syntax of that...
Question 2:
How to compare a character string with one of the value in that
structure????????
Since you don't give much context, the following code is
a literal answer to your questions. Given more information
about the purpose of your program, I suspect there may be
a more appropriate solution(s).

#include <iostream>
#include <map>
#include <string>

/* Question 1 answer: */

struct S /* a structure for storing two strings */
{
std::string one;
std::string two;
};

int main()
{
std::map<std::string, Sm; /* the map */
/* Question 2 answer: */

S s = {"hello", "world"}; /* a populated structure */
std::string comp = "world"; /* a string to compare with */

/* compare 'comp' with one of the struct's strings */
if(comp == s.two)
std::cout << "match\n";
else
std::cout << "no match\n";

return 0;
}

Recommended reading:

www.josuttis.com/libbook

-Mike
Oct 27 '06 #3
Thanks for the help mike...but I am still suffering from problem...I
tried your solution,but it is not working...There are some errors
regarding maps...
Will that work in visual studio?
please help me out...

thanks...

Mike Wahler wrote:
"Anamika" <sh*************@gmail.comwrote in message
news:11**********************@k70g2000cwa.googlegr oups.com...

Question 1:
Can I have maps with following properties?
Key= A character strings...
Value=A structure... Members of structure will be two character
strings....

If yes how to do that?Can anyone tell me the detail syntax of that...

Question 2:
How to compare a character string with one of the value in that
structure????????

Since you don't give much context, the following code is
a literal answer to your questions. Given more information
about the purpose of your program, I suspect there may be
a more appropriate solution(s).

#include <iostream>
#include <map>
#include <string>

/* Question 1 answer: */

struct S /* a structure for storing two strings */
{
std::string one;
std::string two;
};

int main()
{
std::map<std::string, Sm; /* the map */
/* Question 2 answer: */

S s = {"hello", "world"}; /* a populated structure */
std::string comp = "world"; /* a string to compare with */

/* compare 'comp' with one of the struct's strings */
if(comp == s.two)
std::cout << "match\n";
else
std::cout << "no match\n";

return 0;
}

Recommended reading:

www.josuttis.com/libbook

-Mike
Oct 28 '06 #4

"Anamika" <sh*************@gmail.comwrote in message
news:11*********************@m7g2000cwm.googlegrou ps.com...
Thanks for the help mike...but I am still suffering from problem...I
tried your solution,but it is not working...There are some errors
regarding maps...
Will that work in visual studio?
please help me out...
Please don't top post.

What I wrote was not intended to be a 'solution' to
anything, only to illustrate how to do the specific
things you asked about.

When you say 'not working', do you mean it failed to compile?
If so, post the exact code you tried, with the exact error messages
you got.

Did it compile but behave in a way other than what you expected?
If so, state what you expected, and what actually happened.

-Mike


Oct 28 '06 #5
This is the code what I tried...
#include <iostream>
#include <map>
#include <string>
/* Question 1 answer: */
typedef struct S1 /* a structure for storing two strings */
{
std::string one;
std::string two;

}S;
int main()
{
std::map<std::string, Sm; /* the map */

/* Question 2 answer: */

S s ; /* a populated structure */
s.one="hello";
s.two="world";
std::string comp = "world"; /* a string to compare with */
/* compare 'comp' with one of the struct's strings */
if(comp == s.two)
std::cout << "match\n";
else
std::cout << "no match\n";
return 0;

}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Actually there is not much difference,but I just change the way of
initialising the structre...
The previous one was giving me error...
This one is not giving me any error,but giving me 77 warnings...
What wrong with it?Can you compile this and give me the answer?
The actual thing what I want is....

I want to maintain the list of users,there passwords & and a character
string which is specific to the user...
Even I want to access these strings,whenever I want...
either to use or to comare...
These are my requirement..My project is incomplete just because of
that.....
Mike Wahler wrote:
"Anamika" <sh*************@gmail.comwrote in message
news:11*********************@m7g2000cwm.googlegrou ps.com...
Thanks for the help mike...but I am still suffering from problem...I
tried your solution,but it is not working...There are some errors
regarding maps...
Will that work in visual studio?
please help me out...

Please don't top post.

What I wrote was not intended to be a 'solution' to
anything, only to illustrate how to do the specific
things you asked about.

When you say 'not working', do you mean it failed to compile?
If so, post the exact code you tried, with the exact error messages
you got.

Did it compile but behave in a way other than what you expected?
If so, state what you expected, and what actually happened.

-Mike
Oct 29 '06 #6

"Anamika" <sh*************@gmail.comwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
This is the code what I tried...
#include <iostream>
#include <map>
#include <string>
/* Question 1 answer: */
typedef struct S1 /* a structure for storing two strings */
{
std::string one;
std::string two;

}S;
int main()
{
std::map<std::string, Sm; /* the map */

/* Question 2 answer: */

S s ; /* a populated structure */
s.one="hello";
s.two="world";
std::string comp = "world"; /* a string to compare with */
/* compare 'comp' with one of the struct's strings */
if(comp == s.two)
std::cout << "match\n";
else
std::cout << "no match\n";
return 0;

}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Actually there is not much difference,but I just change the way of
initialising the structre...
The previous one was giving me error...
This one is not giving me any error,but giving me 77 warnings...
What are the warnings?

What wrong with it?Can you compile this and give me the answer?
It (the original code I posted) compiled for me with
no warnings or errors.

-Mike
Oct 29 '06 #7
c:\program files\microsoft visual studio\vc98\include\xtree(120) :
warning C4786:
'std::_Tree<std::basic_string<char,std::char_trait s<char>,std::allocator<char>
>,std::pair<std::basic_string<char,std::char_trait s<char>,std::allocator<char const ,
S>,std::map<std::basic_string<char,std::char_trait s<char>,std::allocator<char>
>,S,std::less<std::basic_string<char,std::char_tra its<char>,std::allocator<char >,std::allocator<S::_Kfn,std::less<std::basic_stri ng<char,std::char_traits<char>,std
::allocator<char >,std::allocator<S' : identifier was truncated
to '255' characters in the debug information
c:\program files\microsoft visual studio\vc98\include\map(46) :
see reference to class template instantiation
'std::_Tree<std::basic_string<char,std::char_trait s<char>,std::allocator<char>
>,std::pair<std::basic_string<char,std::char_trait s<
char>,std::allocator<char const
,S>,std::map<std::basic_string<char,std::char_trai ts<char>,std::allocator<char>
>,S,std::less<std::basic_string<char,std::char_tra its<char>,std::allocator<char >,std::allocator<S::_Kfn,std::less<std::basic_st
ring<char,std::char_traits<char>,std::allocator<ch ar
>,std::allocator<S' being compiled
c:\text1.cpp(21) : see reference to class template
instantiation
'std::map<std::basic_string<char,std::char_traits< char>,std::allocator<char>
>,S,std::less<std::basic_string<char,std::char_tra its<char>,std::allocator<char >,std::allocator
<S' being compiled
c:\program files\microsoft visual studio\vc98\include\xtree(120) :
warning C4786:
'std::_Tree<std::basic_string<char,std::char_trait s<char>,std::allocator<char>
>,std::pair<std::basic_string<char,std::char_trait s<char>,std::allocator<char const ,
S>,std::map<std::basic_string<char,std::char_trait s<char>,std::allocator<char>
>,S,std::less<std::basic_string<char,std::char_tra its<char>,std::allocator<char >,std::allocator<S::_Kfn,std::less<std::basic_stri ng<char,std::char_traits<char>,std
::allocator<char >,std::allocator<S::const_iterator' : identifier
was truncated to '255' characters in the debug information
c:\program files\microsoft visual studio\vc98\include\map(46) :
see reference to class template instantiation
'std::_Tree<std::basic_string<char,std::char_trait s<char>,std::allocator<char>
>,std::pair<std::basic_string<char,std::char_trait s<
char>,std::allocator<char const
,S>,std::map<std::basic_string<char,std::char_trai ts<char>,std::allocator<char>
>,S,std::less<std::basic_string<char,std::char_tra its<char>,std::allocator<char >,std::allocator<S::_Kfn,std::less<std::basic_st
ring<char,std::char_traits<char>,std::allocator<ch ar
>,std::allocator<S' being compiled
c:\text1.cpp(21) : see reference to class template
instantiation
'std::map<std::basic_string<char,std::char_traits< char>,std::allocator<char>
>,S,std::less<std::basic_string<char,std::char_tra its<char>,std::allocator<char >,std::allocator
<S' being compiled
c:\program files\microsoft visual studio\vc98\include\xtree(120) :
warning C4786:
'std::_Tree<std::basic_string<char,std::char_trait s<char>,std::allocator<char>
>,std::pair<std::basic_string<char,std::char_trait s<char>,std::allocator<char const ,
S>,std::map<std::basic_string<char,std::char_trait s<char>,std::allocator<char>
>,S,std::less<std::basic_string<char,std::char_tra its<char>,std::allocator<char >,std::allocator<S::_Kfn,std::less<std::basic_stri ng<char,std::char_traits<char>,std
::allocator<char >,std::allocator<S::iterator' : identifier was
truncated to '255' characters in the debug information
c:\program files\microsoft visual studio\vc98\include\map(46) :
see reference to class template instantiation
'std::_Tree<std::basic_string<char,std::char_trait s<char>,std::allocator<char>
>,std::pair<std::basic_string<char,std::char_trait s<
char>,std::allocator<char const
,S>,std::map<std::basic_string<char,std::char_trai ts<char>,std::allocator<char>
>,S,std::less<std::basic_string<char,std::char_tra its<char>,std::allocator<char >,std::allocator<S::_Kfn,std::less<std::basic_st
ring<char,std::char_traits<char>,std::allocator<ch ar
>,std::allocator<S' being compiled
c:\text1.cpp(21) : see reference to class template
instantiation
'std::map<std::basic_string<char,std::char_traits< char>,std::allocator<char>
>,S,std::less<std::basic_string<char,std::char_tra its<char>,std::allocator<char >,std::allocator
<S' being compiled
c:\program files\microsoft visual studio\vc98\include\xtree(120) :
warning C4786:
'std::_Tree<std::basic_string<char,std::char_trait s<char>,std::allocator<char>
>,std::pair<std::basic_string<char,std::char_trait s<char>,std::allocator<char const ,
S>,std::map<std::basic_string<char,std::char_trait s<char>,std::allocator<char>
>,S,std::less<std::basic_string<char,std::char_tra its<char>,std::allocator<char >,std::allocator<S::_Kfn,std::less<std::basic_stri ng<char,std::char_traits<char>,std
::allocator<char >,std::allocator<S::_Node' : identifier was
truncated to '255' characters in the debug information
c:\program files\microsoft visual studio\vc98\include\map(46) :
see reference to class template instantiation
'std::_Tree<std::basic_string<char,std::char_trait s<char>,std::allocator<char>
>,std::pair<std::basic_string<char,std::char_trait s<
char>,std::allocator<char const
,S>,std::map<std::basic_string<char,std::char_trai ts<char>,std::allocator<char>
>,S,std::less<std::basic_string<char,std::char_tra its<char>,std::allocator<char >,std::allocator<S::_Kfn,std::less<std::basic_st
ring<char,std::char_traits<char>,std::allocator<ch ar
>,std::allocator<S' being compiled
c:\text1.cpp(21) : see reference to class template
instantiation
'std::map<std::basic_string<char,std::char_traits< char>,std::allocator<char>
>,S,std::less<std::basic_string<char,std::char_tra its<char>,std::allocator<char >,std::allocator
<S' being compiled
c:\program files\microsoft visual studio\vc98\include\xtree(120) :
warning C4786:
'std::_Tree<std::basic_string<char,std::char_trait s<char>,std::allocator<char>
>,std::pair<std::basic_string<char,std::char_trait s<char>,std::allocator<char const ,
S>,std::map<std::basic_string<char,std::char_trait s<char>,std::allocator<char>
>,S,std::less<std::basic_string<char,std::char_tra its<char>,std::allocator<char >,std::allocator<S::_Kfn,std::less<std::basic_stri ng<char,std::char_traits<char>,std
::allocator<char >,std::allocator<S::const_iterator' : identifier
was truncated to '255' characters in the debug information
c:\program files\microsoft visual studio\vc98\include\map(46) :
see reference to class template instantiation
'std::_Tree<std::basic_string<char,std::char_trait s<char>,std::allocator<char>
>,std::pair<std::basic_string<char,std::char_trait s<
char>,std::allocator<char const
,S>,std::map<std::basic_string<char,std::char_trai ts<char>,std::allocator<char>
>,S,std::less<std::basic_string<char,std::char_tra its<char>,std::allocator<char >,std::allocator<S::_Kfn,std::less<std::basic_st
ring<char,std::char_traits<char>,std::allocator<ch ar
>,std::allocator<S' being compiled
c:\text1.cpp(21) : see reference to class template
instantiation
'std::map<std::basic_string<char,std::char_traits< char>,std::allocator<char>
>,S,std::less<std::basic_string<char,std::char_tra its<char>,std::allocator<char >,std::allocator
<S' being compiled
c:\text1.cpp(26) : error C2552: 's' : non-aggregates cannot be
initialized with initializer list
Error executing cl.exe.
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
This error and warnings I get, when I compiled that code...
And if I do the changes to avoid that error,I get 77 warnings.The same
code I posted you....

Mike Wahler wrote:
"Anamika" <sh*************@gmail.comwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
This is the code what I tried...
#include <iostream>
#include <map>
#include <string>
/* Question 1 answer: */
typedef struct S1 /* a structure for storing two strings */
{
std::string one;
std::string two;

}S;
int main()
{
std::map<std::string, Sm; /* the map */

/* Question 2 answer: */

S s ; /* a populated structure */
s.one="hello";
s.two="world";
std::string comp = "world"; /* a string to compare with */
/* compare 'comp' with one of the struct's strings */
if(comp == s.two)
std::cout << "match\n";
else
std::cout << "no match\n";
return 0;

}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Actually there is not much difference,but I just change the way of
initialising the structre...
The previous one was giving me error...
This one is not giving me any error,but giving me 77 warnings...

What are the warnings?

What wrong with it?Can you compile this and give me the answer?

It (the original code I posted) compiled for me with
no warnings or errors.

-Mike
Oct 30 '06 #8
c:\program files\microsoft visual studio\vc98\include\xtree(120) :
warning C4786:
'std::_Tree<std::basic_string<char,std::char_trait s<char>,std::allocator<char>
>,std::pair<std::basic_string<char,std::char_trait s<char>,std::allocator<char const ,
S>,std::map<std::basic_string<char,std::char_trait s<char>,std::allocator<char>
>,S,std::less<std::basic_string<char,std::char_tra its<char>,std::allocator<char >,std::allocator<S::_Kfn,std::less<std::basic_stri ng<char,std::char_traits<char>,std
::allocator<char >,std::allocator<S' : identifier was truncated
to '255' characters in the debug information
c:\program files\microsoft visual studio\vc98\include\map(46) :
see reference to class template instantiation
'std::_Tree<std::basic_string<char,std::char_trait s<char>,std::allocator<char>
>,std::pair<std::basic_string<char,std::char_trait s<
char>,std::allocator<char const
,S>,std::map<std::basic_string<char,std::char_trai ts<char>,std::allocator<char>
>,S,std::less<std::basic_string<char,std::char_tra its<char>,std::allocator<char >,std::allocator<S::_Kfn,std::less<std::basic_st
ring<char,std::char_traits<char>,std::allocator<ch ar
>,std::allocator<S' being compiled
c:\text1.cpp(21) : see reference to class template
instantiation
'std::map<std::basic_string<char,std::char_traits< char>,std::allocator<char>
>,S,std::less<std::basic_string<char,std::char_tra its<char>,std::allocator<char >,std::allocator
<S' being compiled
c:\program files\microsoft visual studio\vc98\include\xtree(120) :
warning C4786:
'std::_Tree<std::basic_string<char,std::char_trait s<char>,std::allocator<char>
>,std::pair<std::basic_string<char,std::char_trait s<char>,std::allocator<char const ,
S>,std::map<std::basic_string<char,std::char_trait s<char>,std::allocator<char>
>,S,std::less<std::basic_string<char,std::char_tra its<char>,std::allocator<char >,std::allocator<S::_Kfn,std::less<std::basic_stri ng<char,std::char_traits<char>,std
::allocator<char >,std::allocator<S::const_iterator' : identifier
was truncated to '255' characters in the debug information
c:\program files\microsoft visual studio\vc98\include\map(46) :
see reference to class template instantiation
'std::_Tree<std::basic_string<char,std::char_trait s<char>,std::allocator<char>
>,std::pair<std::basic_string<char,std::char_trait s<
char>,std::allocator<char const
,S>,std::map<std::basic_string<char,std::char_trai ts<char>,std::allocator<char>
>,S,std::less<std::basic_string<char,std::char_tra its<char>,std::allocator<char >,std::allocator<S::_Kfn,std::less<std::basic_st
ring<char,std::char_traits<char>,std::allocator<ch ar
>,std::allocator<S' being compiled
c:\text1.cpp(21) : see reference to class template
instantiation
'std::map<std::basic_string<char,std::char_traits< char>,std::allocator<char>
>,S,std::less<std::basic_string<char,std::char_tra its<char>,std::allocator<char >,std::allocator
<S' being compiled
c:\program files\microsoft visual studio\vc98\include\xtree(120) :
warning C4786:
'std::_Tree<std::basic_string<char,std::char_trait s<char>,std::allocator<char>
>,std::pair<std::basic_string<char,std::char_trait s<char>,std::allocator<char const ,
S>,std::map<std::basic_string<char,std::char_trait s<char>,std::allocator<char>
>,S,std::less<std::basic_string<char,std::char_tra its<char>,std::allocator<char >,std::allocator<S::_Kfn,std::less<std::basic_stri ng<char,std::char_traits<char>,std
::allocator<char >,std::allocator<S::iterator' : identifier was
truncated to '255' characters in the debug information
c:\program files\microsoft visual studio\vc98\include\map(46) :
see reference to class template instantiation
'std::_Tree<std::basic_string<char,std::char_trait s<char>,std::allocator<char>
>,std::pair<std::basic_string<char,std::char_trait s<
char>,std::allocator<char const
,S>,std::map<std::basic_string<char,std::char_trai ts<char>,std::allocator<char>
>,S,std::less<std::basic_string<char,std::char_tra its<char>,std::allocator<char >,std::allocator<S::_Kfn,std::less<std::basic_st
ring<char,std::char_traits<char>,std::allocator<ch ar
>,std::allocator<S' being compiled
c:\text1.cpp(21) : see reference to class template
instantiation
'std::map<std::basic_string<char,std::char_traits< char>,std::allocator<char>
>,S,std::less<std::basic_string<char,std::char_tra its<char>,std::allocator<char >,std::allocator
<S' being compiled
c:\program files\microsoft visual studio\vc98\include\xtree(120) :
warning C4786:
'std::_Tree<std::basic_string<char,std::char_trait s<char>,std::allocator<char>
>,std::pair<std::basic_string<char,std::char_trait s<char>,std::allocator<char const ,
S>,std::map<std::basic_string<char,std::char_trait s<char>,std::allocator<char>
>,S,std::less<std::basic_string<char,std::char_tra its<char>,std::allocator<char >,std::allocator<S::_Kfn,std::less<std::basic_stri ng<char,std::char_traits<char>,std
::allocator<char >,std::allocator<S::_Node' : identifier was
truncated to '255' characters in the debug information
c:\program files\microsoft visual studio\vc98\include\map(46) :
see reference to class template instantiation
'std::_Tree<std::basic_string<char,std::char_trait s<char>,std::allocator<char>
>,std::pair<std::basic_string<char,std::char_trait s<
char>,std::allocator<char const
,S>,std::map<std::basic_string<char,std::char_trai ts<char>,std::allocator<char>
>,S,std::less<std::basic_string<char,std::char_tra its<char>,std::allocator<char >,std::allocator<S::_Kfn,std::less<std::basic_st
ring<char,std::char_traits<char>,std::allocator<ch ar
>,std::allocator<S' being compiled
c:\text1.cpp(21) : see reference to class template
instantiation
'std::map<std::basic_string<char,std::char_traits< char>,std::allocator<char>
>,S,std::less<std::basic_string<char,std::char_tra its<char>,std::allocator<char >,std::allocator
<S' being compiled
c:\program files\microsoft visual studio\vc98\include\xtree(120) :
warning C4786:
'std::_Tree<std::basic_string<char,std::char_trait s<char>,std::allocator<char>
>,std::pair<std::basic_string<char,std::char_trait s<char>,std::allocator<char const ,
S>,std::map<std::basic_string<char,std::char_trait s<char>,std::allocator<char>
>,S,std::less<std::basic_string<char,std::char_tra its<char>,std::allocator<char >,std::allocator<S::_Kfn,std::less<std::basic_stri ng<char,std::char_traits<char>,std
::allocator<char >,std::allocator<S::const_iterator' : identifier
was truncated to '255' characters in the debug information
c:\program files\microsoft visual studio\vc98\include\map(46) :
see reference to class template instantiation
'std::_Tree<std::basic_string<char,std::char_trait s<char>,std::allocator<char>
>,std::pair<std::basic_string<char,std::char_trait s<
char>,std::allocator<char const
,S>,std::map<std::basic_string<char,std::char_trai ts<char>,std::allocator<char>
>,S,std::less<std::basic_string<char,std::char_tra its<char>,std::allocator<char >,std::allocator<S::_Kfn,std::less<std::basic_st
ring<char,std::char_traits<char>,std::allocator<ch ar
>,std::allocator<S' being compiled
c:\text1.cpp(21) : see reference to class template
instantiation
'std::map<std::basic_string<char,std::char_traits< char>,std::allocator<char>
>,S,std::less<std::basic_string<char,std::char_tra its<char>,std::allocator<char >,std::allocator
<S' being compiled
c:\text1.cpp(26) : error C2552: 's' : non-aggregates cannot be
initialized with initializer list
Error executing cl.exe.
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
This error and warnings I get, when I compiled that code...
And if I do the changes to avoid that error,I get 77 warnings.The same
code I posted you....

Mike Wahler wrote:
"Anamika" <sh*************@gmail.comwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
This is the code what I tried...
#include <iostream>
#include <map>
#include <string>
/* Question 1 answer: */
typedef struct S1 /* a structure for storing two strings */
{
std::string one;
std::string two;

}S;
int main()
{
std::map<std::string, Sm; /* the map */

/* Question 2 answer: */

S s ; /* a populated structure */
s.one="hello";
s.two="world";
std::string comp = "world"; /* a string to compare with */
/* compare 'comp' with one of the struct's strings */
if(comp == s.two)
std::cout << "match\n";
else
std::cout << "no match\n";
return 0;

}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Actually there is not much difference,but I just change the way of
initialising the structre...
The previous one was giving me error...
This one is not giving me any error,but giving me 77 warnings...

What are the warnings?

What wrong with it?Can you compile this and give me the answer?

It (the original code I posted) compiled for me with
no warnings or errors.

-Mike
Oct 30 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Mike - EMAIL IGNORED | last post by:
I am looking for software that would translate xml strings to and from nested std:maps. Any suggestions? Thanks in advance. Mike.
2
by: ash | last post by:
Hi, I'm getting started with STL, and am stuck at creating a map container. I checked one of the texts and found a code in there. To make it simple, i wrote the following: #include...
4
by: Simon Elliott | last post by:
Here's a small example which uses std::maps within std::maps. Note the line flagged // *** copy? #include <iostream> #include <map> #include <string> struct Tfoo { Tfoo():i1_(0),i2_(0){}
1
by: Jim Tarrant | last post by:
Hi, When I run our application under PurifyPlus, I get lots of "UMR: Uninitialized memory read" warnings, e.g. UMR: Uninitialized memory read in std::_Tree_nod<class std::_Tmap_traits<class...
2
by: Gernot Frisch | last post by:
Hi, I know I can give a std::map a sorting function in the c'tor. However, I would need to _change_ the sorting behaviour of an existing instance. How would I do that? Thank you, --
5
by: DrLex | last post by:
This is a really annoying thing to look up in Google because all pages that mention STL maps or vectors will most likely also contain the word "template". So maybe this question has been asked...
5
by: pallav | last post by:
I have a map like this: typedef boost::shared_ptr<NodeNodePtr; typedef std::vector<NodePtrNodeVecPtr; typedef std::map<std::string, NodePtrNodeMap; typedef std::map<std:string,...
3
by: jacek.dziedzic | last post by:
Hi! What is the canonical way of finding an intersection of two std::maps? i.e. I have std::map<whatever,size_tmap1; std::map<whatever,size_tmap2; .... and I need an std::vector...
6
by: Hicham Mouline | last post by:
Hello, I am attempting to design a class: class C { std::map<double, const Ama; std::map<double, const Bma; ..
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.