C structures help!

This is a discussion on C structures help! within the C Programming forums, part of the General Programming Boards category; Hi, This is a C programming problem. I've a structure with 100 members. How can i print out all 100 ...

  1. #1
    Registered User
    Join Date
    Nov 2002
    Posts
    2

    Unhappy C structures

    Hi,

    This is a C programming problem.

    I've a structure with 100 members.
    How can i print out all 100 members of the structure, and the respective values they hold, without having to output each member 100 times thru' the printf statement?

  2. #2
    Registered User
    Join Date
    Nov 2002
    Posts
    2

    Unhappy C structures help!

    hi,

    This is a C structure problem.

    I've a structure of 50 members. How can i output all 100 members and their respective values they hold, without having to output the printf statement 100 times ?

    In short, can i output the members without knowing the member names?
    Like using a For() loop, to loop thru all the 100 members and output thru' printf ?

  3. #3
    Registered User
    Join Date
    Aug 2001
    Posts
    202
    I've never heard of a way to do this, and as structure members are nothing but variables, my inclination is to believe that it is not possible, sorry.

    starX
    www.axisoftime.com

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 07-11-2008, 08:39 AM
  2. Structures, passing array of structures to function
    By saahmed in forum C Programming
    Replies: 10
    Last Post: 04-06-2006, 12:06 AM
  3. Input output with structures
    By barim in forum C Programming
    Replies: 10
    Last Post: 04-27-2004, 09:00 PM
  4. pointers to arrays of structures
    By terryrmcgowan in forum C Programming
    Replies: 1
    Last Post: 06-25-2003, 10:04 AM
  5. Methods for Sorting Structures by Element...
    By Sebastiani in forum C Programming
    Replies: 9
    Last Post: 09-14-2001, 01:59 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21