Probably and easy one

This is a discussion on Probably and easy one within the C++ Programming forums, part of the General Programming Boards category; I need to know what the output of the following three line is: vector<int> v; v.push_back (3); cout<<v[0]; Thanks...

  1. #1
    Registered User
    Join Date
    Jun 2006
    Posts
    1

    Question Probably and easy one

    I need to know what the output of the following three line is:

    vector<int> v;
    v.push_back (3);
    cout<<v[0];

    Thanks

  2. #2
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,578
    give it a thought...
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  3. #3
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    22,269
    I need to know why you cant write a program to find out.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,824
    Mmm - 5 seconds to try it with your own compiler?
    Several hours to wait for replies telling you to use your compiler.

    That's tough.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21