Max value of an element in array of structs

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chevon1920
    New Member
    • Feb 2008
    • 12

    #1

    Max value of an element in array of structs

    I have a question about structures. I need to write a function that will find the max value of one element of an array of structures. I know how to find the max value of the array of structures, but how do I get the function to return the entire structure not just that portion of it? If that makes any sense.
  • oler1s
    Recognized Expert Contributor
    • Aug 2007
    • 671

    #2
    You cannot access a member of a structure without knowing what structure you are accessing. That is, if you can return a portion of a structure, you should be able to return the entire structure itself.

    If you are unable to see how, post some code showing where you run into difficulty.

    Comment

    • chevon1920
      New Member
      • Feb 2008
      • 12

      #3
      Thanks for the reply. I realized my professor wanted to return a double instead, so its not necessary.

      Thanks

      Comment

      Working...