trying to use vectors
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.
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]
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]
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!
#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!
1.
2.
3.
4. Take another look at your
5.
6. So,
[ 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]
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]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement