value_type of vector

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • George2

    #1

    value_type of vector

    Hello everyone,


    I think the value_type of vector<intshoul d be int and the value_type
    of vector<intshoul d be int*. But I am not 100% sure,

    1. how to write a program to verify this idea;
    2. where to find the definition that the value_type of interator of
    vector<intis int*.

    It is appreciated if you could help.

    Code:
    #include <vector>
    
    using namespace std;
    
    int main (int argc, char** argv)
    {
    vector<int>::value_type;  // should be int ?
    vector<int>::iterator::value_type; // should be int* ?
    
    return 0;
    }

    thanks in advance,
    George
  • Richard Heathfield

    #2
    Re: value_type of vector

    George2 said:
    I think the value_type of vector<intshoul d be int and the value_type
    of vector<intshoul d be int*. But I am not 100% sure,
    >
    1. how to write a program to verify this idea;
    2. where to find the definition that the value_type of interator of
    vector<intis int*.
    Try asking in comp.lang.c++, where they might have a fighting chance of
    answering your question correctly.

    --
    Richard Heathfield <http://www.cpax.org.uk >
    Email: -http://www. +rjh@
    Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
    "Usenet is a strange place" - dmr 29 July 1999

    Comment

    • santosh

      #3
      Re: value_type of vector

      In article
      <2be2481b-8566-4fa0-81ff-fd556a5d5a77@e1 0g2000prf.googl egroups.com>,
      George2 <george4academi c@yahoo.comwrot e on Monday 19 Nov 2007 8:40
      am:
      Hello everyone,
      >
      >
      I think the value_type of vector<intshoul d be int and the value_type
      of vector<intshoul d be int*. But I am not 100% sure,
      >
      1. how to write a program to verify this idea;
      2. where to find the definition that the value_type of interator of
      vector<intis int*.
      >
      It is appreciated if you could help.
      >
      Code:
      #include <vector>
      >
      using namespace std;
      >
      int main (int argc, char** argv)
      {
      vector<int>::value_type;  // should be int ?
      vector<int>::iterator::value_type; // should be int* ?
      >
      return 0;
      }
      Isn't this the third time you have posted C++ code or question to a C
      group? Please post C++ questions in <news:comp.lang .c++>.

      Comment

      • Martin Ambuhl

        #4
        Re: value_type of vector

        George2 wrote:
        Hello everyone,
        >
        >
        I think the value_type of vector<intshoul d be int and the value_type
        of vector<intshoul d be int*. But I am not 100% sure,
        'vector<int>' is a syntax error in C. You probably want a newsgroup for
        a different language, perhaps one where 'value_type' actually has a meaning.

        Comment

        Working...