Intialization and fill of an array of structures of type data

Discussion in 'Software' started by kim80109, Feb 9, 2011.

  1. kim80109

    kim80109

    Joined:
    Feb 9, 2011
    Messages:
    1
    The following program contains an array of structures of type data_t. The declaration for the variable ‘d’ of type data_t is given. Write logic into the main program to allocate memory for variable ‘d’ such it contains an array of 500 elements, each of type data_t. Don’t be concerned with freeing the memory or testing the return value of malloc for NULL. Then, write function ‘f1’ to fill in each of the 500 elements of the array such that the integer field ‘ival’ has the values 1-500 for array indexes 0-499 respectively, and the string field ‘sval’ contains the string “$1” – “$500” for array indexes 0-499 respectively. The call for function ‘f1’ is given at the end of the main program.

    Hi All,

    Need some help... kinda stuck with an segmentation error. Much Appreciated!
    kim80109, Feb 9, 2011
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?ZnJlZA==?=

    Driver intialization sequence

    =?Utf-8?B?ZnJlZA==?=, Dec 17, 2004, in forum: Wireless Networking
    Replies:
    2
    Views:
    570
    =?Utf-8?B?ZnJlZA==?=
    Dec 17, 2004
  2. Dale
    Replies:
    2
    Views:
    483
  3. amrutha0303
    Replies:
    0
    Views:
    978
    amrutha0303
    Aug 3, 2010
  4. amrutha0303
    Replies:
    0
    Views:
    2,122
    amrutha0303
    Aug 3, 2010
  5. Neal
    Replies:
    0
    Views:
    1,472
Loading...

Share This Page