Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. ATL / WTL / STL
  4. Deque

Deque

Scheduled Pinned Locked Moved ATL / WTL / STL
c++helpquestion
2 Posts 1 Posters 3 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    danag
    wrote on last edited by
    #1

    I am getting an error in the cout statement?? What should I do?? C:\My Documents\lakshmi\cplusplus\stldeque\test.cpp(28) : error C2679: binary '<<' : no operator defined which takes a right-hand operand of type 'class std::deque,class std::allocator main() { string alpha[4] = {"nava", "dana", "lakshmi", "pavi"}; deque ids1; for (int i =0; i<4; i++) { ids1.push_back(alpha[i]); } typedef deque::iterator id_iter1; for (id_iter1 i1 = ids1.begin(); i1 != ids1.end(); i1++ ) cout << *i1 << "\n"; }

    D 1 Reply Last reply
    0
    • D danag

      I am getting an error in the cout statement?? What should I do?? C:\My Documents\lakshmi\cplusplus\stldeque\test.cpp(28) : error C2679: binary '<<' : no operator defined which takes a right-hand operand of type 'class std::deque,class std::allocator main() { string alpha[4] = {"nava", "dana", "lakshmi", "pavi"}; deque ids1; for (int i =0; i<4; i++) { ids1.push_back(alpha[i]); } typedef deque::iterator id_iter1; for (id_iter1 i1 = ids1.begin(); i1 != ids1.end(); i1++ ) cout << *i1 << "\n"; }

      D Offline
      D Offline
      danag
      wrote on last edited by
      #2

      i changed the iterator initialzation, and changed the order of the include files, and the code worked... #include #include #include using namespace std; main() { string alpha[4] = {"nava", "dana", "lakshmi", "pavi"}; deque ids1; for (int i =0; i<4; i++) { ids1.push_back(alpha[i]); } deque::iterator id_iter1 = ids1.begin(); for (; id_iter1 != ids1.end(); id_iter1++ ) cout << *id_iter1 << "\n"; }

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups