Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


trying to use vectors

This topic is 5453 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I haven''t used .net myself but "undeclared identifier" usually means that it can''t find the command because you forgot to include som header file.. cin is from the stdio.h I think so if you include that, it should fix that problem for instance.. You should go to google and search for tutorials on vstudio.net programming and using vectors... Should be plenty of info. As I said I haven''t used vstudio.net myself but google is always a good source of information.

Share this post

Link to post
Share on other sites
cin is in .

"Passion is what drives you to stay up until 4am fixing that bug that hardly anyone would notice...Passion is where great games come from, if you dont live and breathe games you shouldn''t be in the games industry." - Dave Pottinger, Ensemble Studios

[GameDev][C++ Page][Game Tutorials][FreeBSD][HawkNL(Hawk Network Library)][NeHe Productions][Gamedev book''s]
[Virtually Online-Books][Mage Tower Ent-My Site]

Share this post

Link to post
Share on other sites
Don''t you need this:

#include <vector>

Also, you might want to declare which namespace you''re using:

using namespace std;
// Put this in directly after your include statements

Apart from that it looks OK I think...


Yes. it''''s true, I DO wield the ugly stick. And I see I have beaten you with it before!

Share this post

Link to post
Share on other sites
1. std::vector is defined in <vector> - #include <vector>
2. vector is part of the std namespace - std::vector<int> scorav;.
3. cin is part of the std namespace - std::cin.
4. Take another look at your for loop. Revise it.
5. std::vector does not define a parenthesis operator (operator()) as a member function. Most likely you meant to use the subscript operator - scorav[y].
6. So, count and score are for what?

[ Google || Start Here || ACCU || STL || Boost || MSDN || GotW || CUJ || MSVC++ Library Fixes || BarrysWorld || E-Mail Me ]

[edited by - Lektrix on October 21, 2003 11:47:55 AM]

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!