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 9033789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T08:19:09+00:00 2026-06-16T08:19:09+00:00

I have a nested vector of strings like: std::vector<std::vector<string>> I want to access eight

  • 0

I have a nested vector of strings like:

std::vector<std::vector<string>>

I want to access eight element of inner vector which is itself second element of outer vector.

  • 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-16T08:19:10+00:00Added an answer on June 16, 2026 at 8:19 am

    Just as you would with a two-dimensional array:

    std::vector<std::vector<std::string>> vec;
    // Fill it
    std::cout << vec[1][7] << std::endl;
    

    If you want bounds checking, use std::vector::at:

    std::cout << vec.at(1).at(7) << std::endl;
    

    Note that the indices are 1 and 7 because indexing starts at 0.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a large nested vector that look like this: import Data.Vector let x
I have a nested drag and drop list which return json formattet string. I
I was wondering if it was faster to have a std::vector<std::vector<double>> where the nested
I started to write a class which would act much like the std::vector but
I have a vector of strings and have to check if each element in
Suppose I have something like this: class Collection { private: typedef std::vector< std::shared_ptr<Something> >::iterator
Is it OK to have a nested iterator like the following? for (vector<type>::iterator i
I have nested iframes and I would like to use onload function for the
What if I have nested loops, and I want to break out of all
I have a number of tables, which have nested tables. I using jQuery to

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.