Thread: Array of Structs question

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Feb 2002
    Posts
    5
    First of all this is C++, not C so you should be using a vector of classes not an array of structs. Here is a link to the STL http://www.sgi.com/tech/stl/ where you can look up everything you need about those. Although I am not sure why you would want to index by name in your case, the way to accomplish that is to use a hash set. Again you can look up all relevant information for that at the above link.

  2. #2
    Registered User
    Join Date
    Aug 2003
    Posts
    1,218
    Correct me if I am wrong but I think an array of structs is completely legal in C++.

  3. #3
    Registered User
    Join Date
    Feb 2002
    Posts
    5
    SHOULD be using, not have to be using. Arrays and structs are perfectly legal in C++, but so are goto statements. The point is that if you are not using classes and vectors you are not utilizing the language properly.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 16
    Last Post: 05-29-2009, 07:25 PM
  2. Printing an array of structs?
    By blernblan in forum C Programming
    Replies: 4
    Last Post: 04-28-2009, 03:04 PM
  3. Struct *** initialization
    By Saravanan in forum C Programming
    Replies: 20
    Last Post: 10-09-2003, 12:04 PM
  4. array of structs initialization - PLZ help...
    By Vanya in forum C++ Programming
    Replies: 2
    Last Post: 12-11-2002, 08:10 PM
  5. Help with an Array
    By omalleys in forum C Programming
    Replies: 1
    Last Post: 07-01-2002, 08:31 AM