User Profile

Collapse

Profile Sidebar

Collapse
tinie
tinie
Last Activity: Feb 18 '07, 06:26 AM
Joined: Jan 27 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • tinie
    started a topic how to insert elements in a 2d vector?
    in C

    how to insert elements in a 2d vector?

    I encounter problems in inserting elements in a 2d vector. For example I want to insert 99 in v[2][5], how would I do it? What I have is this code:
    Code:
      #include <iostream>
    #include <iomanip>
    #include <vector>
    
    int main()
    {
      std::vector< std::vector<int> > v;
    
      for ( int i = 0; i < 10; i++ ) {
        v.push_back ( std::vector<int>()
    ...
    See more | Go to post

  • What I have is a two 2d vector, which like a 2d array and it looks like what Ganon11 illustrated in the previous post. Let's take what was illustrated in the previous reply. Is there a predefined function in c++ (or in the STL) that could help me find 'h' 'e' 'l' 'p' in the 2d vector? the 2d vector is constructed as:

    Code:
    vector <vector <char> > notes;
    and the elements are placed in the vector by making calls...
    See more | Go to post

    Leave a comment:


  • what can i use to find a series of characters in a 2d vector of character?

    I am just starting in c++ programming in Linux and currently, I have a 2d vector of characters, what function (or functions )can i use to find a series of characters in my vector? For example, I want to find 'h' 'e' 'l' 'p' within the 2d vector.
    See more | Go to post

  • tinie
    started a topic how to resize a 2D vector?
    in C

    how to resize a 2D vector?

    How can I resize a 2D vector of int? initially i have declared vector<vector<i nt> > value;
    I saw that
    Code:
    void resize(n, t = T())
    should be used, but I can't seem to understand how it works. I want to initialize the added elements initialed to some integer value, say 1. how can I do that?

    Thanks for the help.
    See more | Go to post
No activity results to display
Show More
Working...