It''s OK, I got it all fixed for good now, it seems that I haven''t include the header files.. which is weird.. I thought the compiler automatically include stdio/lib ??
anyway this bring another question.. for a standard Win32 programming which header files shoud I inculde in my code ??
I cannot use STL, why ???
I had a problem with replacing the old fstream.h to the new fstream which is also a class of STL.
when 'using namespace' it's important that there will be no old liberaries, for example:
is bad because of a mixure of old and new libararies
instead you should write
[edited by - alissre on November 22, 2002 11:58:30 AM]
when 'using namespace' it's important that there will be no old liberaries, for example:
#include fstream.h#include <vector>using namespace
is bad because of a mixure of old and new libararies
instead you should write
#include fstream.h #include <std::vector>
[edited by - alissre on November 22, 2002 11:58:30 AM]
Sorry, it seems I didnt realize that this wouldn''t let me use > or < symbols unless I wrote the HTML code thingy for it :-(
quote:Original post by alissre
I had a problem with replacing the old fstream.h to the new fstream which is also a class of STL.
when ''using namespace'' it''s important that there will be no old liberaries, for example:
#include fstream.h
#include <vector>
using namespace
is bad because of a mixure of old and new libararies
instead you should write
#include fstream.h
#include <std::vector&ht
Er, something went wrong there. fstream.h is the old deprecated header. Don''t use this unless you have to for backwards compatibility. std::vector is not a file so you can''t include it.
How about something more like this:
#include <vector>
#include <fstream>
int main
{
using namespace std;
}
500 try1
- Magmai Kai Holmlor
"Oh, like you''ve never written buggy code" - Lee
[Look for information | GDNet Start Here | GDNet Search Tool | GDNet FAQ | MSDN RTF[L] | SGI STL Docs | STFW | Asking Smart Questions ]
[Free C++ Libraries | Boost | ACE | Loki | MTL | Blitz++ | wxWindows| Spirit(xBNF)]
[Free C Libraries | zlib ]
just to clear things up
Yes, this is the correct answer. Ignore other different posts.
My compiler generates one error message: "does not compile."
[edited by - alnite on November 23, 2002 4:36:34 AM]
quote:Original post by flangazor
#include <vector>
std::vector <someType> myVector;
This is the correct answer.
Yes, this is the correct answer. Ignore other different posts.
My compiler generates one error message: "does not compile."
[edited by - alnite on November 23, 2002 4:36:34 AM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement