Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7731381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T06:27:56+00:00 2026-06-01T06:27:56+00:00

I am developing a games library where I can add or delete my games.

  • 0

I am developing a games library where I can add or delete my games.
So far I just made a list with 3 games in standard, but when i was trying to test it. It gave me an error.

I am trying to do it with an iteration on my vector, but for some reason it won’t work. And i can’t find that reason.

here’s my code:

#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main()
{

vector<int>::const_iterator iter;

vector<string> games;
games.push_back("Crysis 2");
games.push_back("God of War 3");
games.push_back("FIFA 12");

cout <<"Welcome to your Games Library.\n";
cout <<"These are your games:\n";
for (iter = games.begin(); iter != games.end(); ++iter)
{
    cout <<*iter <<endl;
}

return 0;

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T06:27:57+00:00Added an answer on June 1, 2026 at 6:27 am

    the types of you iterator and your vetcor are incompatible.

    use:

    vector<string>::const_iterator iter;
    

    To make things easier it might be better to typedef your collection type:

    typedef std::vector<std::string> GamesListType;
    GamesListType::const_iterator iter;
    GamesListType games;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anyone recommend a good Java game engine for developing simple tile-based games? I'm
i was following the David Brackeen's Developing Games in Java book and i made
i am trying out a pong game to start out developing games on the
I was just wondering why c++ ist that powerful and performant for developing games.
I am developing a library which can be compiled for two different technologies. Basically,
I'm developing an application that detects Source-based games running on the LAN. Following up
Hi i am developing game level editor.Currently I am using win32 with directX.But with
I'm developing chess game for Android ( androidchess.appspot.com ). If I want to add
i'm developing a android game which uses libgdx and bullet physics engine. I can
I have one question but it can probably be answered by one of several

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.