By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,330 Members | 1,425 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,330 IT Pros & Developers. It's quick & easy.

How to Inlcude STL::Map

P: n/a
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

Dec 22 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
vi***********@gmail.com wrote:
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
Dec 22 '05 #2

P: n/a

vi***********@gmail.com wrote:
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

Dec 22 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.