Advertisement Jump to content
Sign in to follow this  
Josheir

Problem with Very Simple Vector Container C++

This topic is 622 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

Hello, need help please, here is some simple example Visual C++ code:

 

#include <vector>

.

.

.

int i = 1;

std::vector<int> myvector;

myvector.push_back(i);

 

It seems no matter what I do the myvector right before the command push_back has a red squiggle!

 

I searched for vector in the C drive and there was no match.  There were some search results for Vector2, Vector3, Vector2_8hpp_source.  Perhaps I need to get a vector header file from somewhere?

 

Thank you,

Josheir

 

Share this post


Link to post
Share on other sites
Advertisement
Does your compiler know this is C++, or does it think it's C? (only thing I can think of)

Share this post


Link to post
Share on other sites

Well I'm using some classes, so it knows its C++.  I'm thinking because the file search didn't  turn up a file : vector.h that this could be the problem?

 

Thanks again,

josheir

 

This is my first try using containers.

Share this post


Link to post
Share on other sites

Stupid me, just started coding again I was in a global section instead of a function!

Sorry, everyone!

Share this post


Link to post
Share on other sites
Why would you look for `vector.h' if the file being included is simply `vector'?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!