trying to use vectors

Started by
3 comments, last by ScottC 20 years, 5 months ago
Using vstudio.net http://rafb.net/paste/results/T2884226.html theres the code and errors.
Advertisement
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.
if (!understand) ask;
cin is in .


RanBlade
"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]

Eric Ranaldi a.k.a RanBlade


[size=1]"Passion is what drives you to stay up until 4am fixing that bug that hardly anyone would notice...


[size=1]Passion is where great games come from, if you dont live and breathe games you shouldn't be in the games industry."


[size=2]- Dave Pottinger, Ensemble Studios



[size=1][GameDev][C++ Page][Unity Game Engine][Panda3D Game Engine][NeHe Productions][Drunken Hyena][MSDN][Beej's Guide to Network Programming]


[size=1][FreedBSD][My Site][Gamasutra][Khan Acadamey]

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...

RM.

------------------------------------------------------------
Yes. it''''s true, I DO wield the ugly stick. And I see I have beaten you with it before!
------------------------------------------------------------Yes. it''s true, I DO wield the ugly stick. And I see I have beaten you with it before!
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]
[ Google || Start Here || ACCU || STL || Boost || MSDN || GotW || CUJ || MSVC++ Library Fixes || BarrysWorld || [email=lektrix@barrysworld.com]E-Mail Me[/email] ]

This topic is closed to new replies.

Advertisement