Help with structs/arrays

Home Forums C Programming Help with structs/arrays

Viewing 0 reply threads
  • Author
    Posts
    • #2025
      vivek
      Participant

      Sorry I’m kind of a newbie to programming in general….

      I have an existing program that has a struct that contains a string, int, float values.

      This struct is getting it’s information from a text document that contains those values and works fine.

      I now need to add an array so that same struct will have an array of about 20 and I can load that text file and then display the results. Later, i will need to cout the array that the user chooses from a Menu screen.

      For example I now have in my text document:
      One String
      An Int Value
      An Int value
      One Float Value

      I will need to have:
      One String
      An Int Value
      An Int value
      One Float Value

      One String
      An Int Value
      An Int value
      One Float Value

      One String
      An Int Value
      An Int value
      One Float Value

      .
      .
      .
      …..an so forth.

      I understand the basic concepts of creating arrays/structs, it just confuses me now that I have to also have to add a text file into the mix and combine everything.

      Any help on this would be greatly appreciated!

Viewing 0 reply threads
  • You must be logged in to reply to this topic.
Share
Tweet
Share
Pin