How to Inlcude STL::Map

V

viveque.kumar

How do I go about including an STL::Map in a C file?

Doing:
#include <map>
using namespace std;

gives me a lot of errors in VC7... Ofcourse it is because <map> is a
C++ header file...
Is there anything else I can do to use this STL map here...?

- Vivek
 
R

Richard Bos

How do I go about including an STL::Map in a C file?

You don't.

If you want to use C code in a C++ program, C++ has features for doing
so. C has no features for going the other way.

Richard
 
T

Targeur fou

How do I go about including an STL::Map in a C file?

Doing:
#include <map>
using namespace std;

gives me a lot of errors in VC7... Ofcourse it is because <map> is a
C++ header file...

You have your answer. Why would you include a C++ header in a C file?
C and C++ are two different languages.
Is there anything else I can do to use this STL map here...?

Yes, implementing in C your own associative container.

A+
Regis
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Sorting an STL map 1
STL::MAP: Printing values only once .. 9
TF-IDF 1
Compile error on templated STL map class 3
Modify STL map Object 4
STL map insert Options 8
STL list or map? 33
CCL vs STL: a comparison 29

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,049
Latest member
Allen00Reed

Latest Threads

Top