To use struct.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jafri256best
    New Member
    • Nov 2009
    • 3

    To use struct.

    I want to store 100 student records in an array. and each location of array must contain 4 values string regno,phoneno,n ame,address. How can I do above work through struct?
  • tlhintoq
    Recognized Expert Specialist
    • Mar 2008
    • 3532

    #2
    Personally I'd define it as a class not a struct, just so I would have room in the future to add methods as well as data. But that's just me.

    Make a struct.
    Give it 4 strings for your 4 values
    Make an array of that struct.

    Comment

    • Jafri256best
      New Member
      • Nov 2009
      • 3

      #3
      Thanks it worked. I had an assignmet of doing it through struct nothing else. Thanks Buddy.

      Comment

      Working...