Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Feb 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Solution to C programming exercise ??

    Hi,
    I'm a newbie and cant solve this programming exercise!

    Given this structure:

    typedef struct ContactRecord
    {
    char name[16];
    unsigned char number[20];
    }ContactRecord;

    static ContactRecord ContactTable[MAX_ENTRIES];

    Exercise: Write a C function to write a name and number to any single record of the above ContactTable data structure.

    Any ideas/suggestions??

    Thanks,
    yc

  • #2
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    I suggest you read your course notes and text. Aside from that, if you have a specific question, ask it.
    Are you a Help Vampire?

  • #3
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    Quote Originally Posted by tomws View Post
    I suggest you read your course notes and text. Aside from that, if you have a specific question, ask it.
    Exactly. You need to ask a specific question, per our rules we cannot just do the assignment for you. What is it that you are confused or unsure about?
    OracleGuy

  • #4
    Regular Coder BrickInTheWall's Avatar
    Join Date
    Mar 2009
    Location
    Munich, Germany
    Posts
    139
    Thanks
    1
    Thanked 13 Times in 13 Posts
    The other posters are right.
    If you know how to write a function, look at the question. You basically have to fill the members of an instance of the struct...what arguments would the function need?
    Call me Brick, if you like!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •