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. Design Data structure.

Design Data structure.

Scheduled Pinned Locked Moved C / C++ / MFC
databasedesignquestion
3 Posts 2 Posters 1 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.
  • M Offline
    M Offline
    mikert_2008
    wrote on last edited by
    #1

    Hi, I want to constuct a data structure with following condition- The first structure is having 3 element e.g Name1 ,age1 ,roll no1. The second structure contain the 3 element i.e roll no 1, subject 1 roll no 1, subject 2 roll no 1, subject 3 i.e Roll no may have one or more than one subject associated with it. I want to write a program which will take input as Name,Age, Roll No ,subject(no.of subjects may very). Then I will take Input from user As Roll No, Query the structure and display name,age and subject/s. Can you please suggest which data structure (CMAp,CList... etc.) is suatiable for such condition? Thanks:- Mike

    D 1 Reply Last reply
    0
    • M mikert_2008

      Hi, I want to constuct a data structure with following condition- The first structure is having 3 element e.g Name1 ,age1 ,roll no1. The second structure contain the 3 element i.e roll no 1, subject 1 roll no 1, subject 2 roll no 1, subject 3 i.e Roll no may have one or more than one subject associated with it. I want to write a program which will take input as Name,Age, Roll No ,subject(no.of subjects may very). Then I will take Input from user As Roll No, Query the structure and display name,age and subject/s. Can you please suggest which data structure (CMAp,CList... etc.) is suatiable for such condition? Thanks:- Mike

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      Something like:

      struct
      {
      string name;
      int age;
      int roll;
      vector<string> subjects;
      };

      "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

      "The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch

      M 1 Reply Last reply
      0
      • D David Crow

        Something like:

        struct
        {
        string name;
        int age;
        int roll;
        vector<string> subjects;
        };

        "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

        "The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch

        M Offline
        M Offline
        mikert_2008
        wrote on last edited by
        #3

        hi, Thanks. -Mike

        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