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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Using STL

Using STL

Scheduled Pinned Locked Moved C / C++ / MFC
c++helptutorial
4 Posts 3 Posters 0 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.
  • R Offline
    R Offline
    Rostrox
    wrote on last edited by
    #1

    Many thanks to Ben, anonymous ;) , markkuk. As a result of your help (jun 14) I share the next example program that worked very well for my purposes: // Example about using map #include #include #include #include using namespace std; const int tam=10; struct stTot { string stLey; double dMonto[tam]; }; stTot myTot; map mpCont; string clave; int main() { myTot.stLey = "Text one"; for(int i=0; i::iterator it = mpCont.find("one"); cout << (*it).first << " " << (*it).second.dMonto[3] << endl; it = mpCont.find(clave); cout << (*it).first << " " << (*it).second.stLey << endl; return 0; } /* Output obtained for both cases is: one 14 two Text two */

    R 1 Reply Last reply
    0
    • R Rostrox

      Many thanks to Ben, anonymous ;) , markkuk. As a result of your help (jun 14) I share the next example program that worked very well for my purposes: // Example about using map #include #include #include #include using namespace std; const int tam=10; struct stTot { string stLey; double dMonto[tam]; }; stTot myTot; map mpCont; string clave; int main() { myTot.stLey = "Text one"; for(int i=0; i::iterator it = mpCont.find("one"); cout << (*it).first << " " << (*it).second.dMonto[3] << endl; it = mpCont.find(clave); cout << (*it).first << " " << (*it).second.stLey << endl; return 0; } /* Output obtained for both cases is: one 14 two Text two */

      R Offline
      R Offline
      Rostrox
      wrote on last edited by
      #2

      Unfortunately, some words or characters seems not to be displayable, for example the include files: these are iostream, string, utility and map, all enclosed in angular parenthesis. There some others but I think these are easy to discover for the interested people. :(

      C 1 Reply Last reply
      0
      • R Rostrox

        Unfortunately, some words or characters seems not to be displayable, for example the include files: these are iostream, string, utility and map, all enclosed in angular parenthesis. There some others but I think these are easy to discover for the interested people. :(

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        They're lost because HTML is parsed in our posts. SO a < > pair is assumed to contain an HTML command and is therefore not shown. To get those signs I used & lt and & gt, without the spaces. Christian #include "std_disclaimer.h" People who love sausage and respect the law should never watch either one being made. The things that come to those who wait are usually the things left by those who got there first.

        L 1 Reply Last reply
        0
        • C Christian Graus

          They're lost because HTML is parsed in our posts. SO a < > pair is assumed to contain an HTML command and is therefore not shown. To get those signs I used & lt and & gt, without the spaces. Christian #include "std_disclaimer.h" People who love sausage and respect the law should never watch either one being made. The things that come to those who wait are usually the things left by those who got there first.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Alternatively you could use the <pre> tag before your code segment and the </pre> after, everything in between should be exactly as you typed it. Michael Martin Pegasystems Pty Ltd Australia martm@pegasystems.com +61 413-004-018

          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