Help with structs/arrays

Home Forums C Programming Help with structs/arrays

This topic contains 0 replies, has 1 voice, and was last updated by  vivek 10 years, 7 months ago.

  • Author
    Posts
  • #2025

    vivek
    Member

    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!

You must be logged in to reply to this topic.