[ Home  |  FAQ-Related Q&As  |  General Q&As  |  Answered Questions ]


    Search the Q&A Archives


#include <IOSTREAM>// #include <map> #include...

<< Back to: Available C++ Libraries FAQ

Question by catmice
Submitted on 12/29/2003
Related FAQ: Available C++ Libraries FAQ
Rating: Rate this question: Vote
#include <IOSTREAM>//
#include <map>
#include <STRING>

using namespace std;

int main()
{
   map<string,string> coll;
   coll.insert(std::make_pair("1","er"));
   cout<<coll["1"];
   return 0;
}
c:\program files\microsoft visual studio\vc98\include\stlport\stl\_pair.h(48): error C2536: 'pair<char [2],char [3]>::first': cannot specify explicit initializer for arrays
    c:\program files\microsoft visual studio\vc98\include\stlport\stl\_pair.h(41): see declaration of 'first'
    c:\program files\microsoft visual studio\vc98\include\stlport\stl\_pair.h(48): while compiling class-template member function 'pair<char [2],char [3]>(const char (&)[2],const char (&)[3])'
c:\program files\microsoft visual studio\vc98\include\stlport\stl\_pair.h(48): error C2536: 'pair<char [2],char [3]>::second': cannot specify explicit initializer for arrays
    c:\program files\microsoft visual studio\vc98\include\stlport\stl\_pair.h(42): see declaration of 'second'
    c:\program files\microsoft visual studio\vc98\include\stlport\stl\_pair.h(48): while compiling class-template member function 'pair<char [2],char [3]>(const char (&)[2],const char (&)[3])'

?????



Answer by Amrendra
Submitted on 12/31/2003
Rating:  Rate this answer: Vote
Try
coll.insert(std::make_pair(string("1"),string("er")));

 

Answer by asdfghj
Submitted on 5/31/2005
Rating: Not yet rated Rate this answer: Vote
im noooooooooooooooooooob

 

Answer by tmp123123
Submitted on 11/16/2005
Rating: Not yet rated Rate this answer: Vote
#include <stdlib.h>
#include <stdio.h>

add those will fix it

 

Answer by YanQi Qiu
Submitted on 3/31/2006
Rating: Not yet rated Rate this answer: Vote
Just as you said:Try
coll.insert(std::make_pair(string("1"),string("er")));
the problem have been solved!
Thank You!

 

Answer by mokrani
Submitted on 4/17/2007
Rating: Not yet rated Rate this answer: Vote
thank you

 

Answer by huh
Submitted on 4/25/2007
Rating: Not yet rated Rate this answer: Vote
or try this

cout << fixed << showpoint << setprecision(coll.insert(););

then

std::string("1");

 

Your answer will be published for anyone to see and rate.  Your answer will not be displayed immediately.  If you'd like to get expert points and benefit from positive ratings, please create a new account or login into an existing account below.


Your name or nickname:
If you'd like to create a new account or access your existing account, put in your password here:
Your answer:

FAQS.ORG reserves the right to edit your answer as to improve its clarity.  By submitting your answer you authorize FAQS.ORG to publish your answer on the WWW without any restrictions. You agree to hold harmless and indemnify FAQS.ORG against any claims, costs, or damages resulting from publishing your answer.

 

FAQS.ORG makes no guarantees as to the accuracy of the posts. Each post is the personal opinion of the poster. These posts are not intended to substitute for medical, tax, legal, investment, accounting, or other professional advice. FAQS.ORG does not endorse any opinion or any product or service mentioned mentioned in these posts.

 

<< Back to: Available C++ Libraries FAQ


[ Home  |  FAQ-Related Q&As  |  General Q&As  |  Answered Questions ]

© 2008 FAQS.ORG. All rights reserved.