Like Tree1Likes
  • 1 Post By Adak

structure program I need some fidback, please

This is a discussion on structure program I need some fidback, please within the C Programming forums, part of the General Programming Boards category; I wrote part of the program. Could somebody give me some fidback if sees any errors. It's a part of ...

  1. #1
    Registered User
    Join Date
    Jul 2011
    Posts
    1

    structure program I need some fidback, please

    I wrote part of the program. Could somebody give me some fidback if sees any errors. It's a part of long project so I don't want to start new part until I don't understand the first one. What I need to do in this program is to create a typedef structure which support the data show below.

    Buny Andersone 23 Male
    Barney Nudble 33 Male
    Wilma Andersone 33 Female
    Betty Nudble 22 Female
    Pebbles Andersone 9 Female
    Warmmam Nudble 7 Male
    Nino Flipostone 6 Male
    Attached Files Attached Files
    • File Type: c str.c (1.5 KB, 71 views)

  2. #2
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    Welcome to the forum, BomiM!

    Rather than asking us to study and /or test your code, don't you want to see if it works under real adverse testing? If you're going to write programs, you need to find ways to test each block of code or function. You can test it quite thoroughly, before the whole program is written, of course!

    Give it some real "corkers" to deal with - bad input, file not found, first, middle and last record in the file or array can't be edited or found in the search. You know the chinks where it could fail, I hope. To test functions that call other functions that aren't written yet, just put in stubs for now:

    Code:
    void mystub(void) {
      
    
    }
    You may get a warning from your compiler, but you can ignore it.

    One of the big reasons for functions in the first place, is that they improve encapsulation of code/logic/function, which helps us test each part of the program, as we are coding it. Use that encapsulation, to your advantage, as you test.

    The age struct member --- why does it need [4] int's? Wouldn't one int be enough? (You were thinking of digits maybe, in a string? Those aren't int's though.)
    AndrewHunter likes this.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 4
    Last Post: 11-22-2006, 12:20 PM
  2. Structure of a C++ program.
    By CrazYjoe in forum C++ Programming
    Replies: 3
    Last Post: 10-05-2006, 07:07 AM
  3. structure program
    By prlove71 in forum C++ Programming
    Replies: 1
    Last Post: 03-08-2002, 09:01 PM
  4. program structure
    By C_Coder in forum C Programming
    Replies: 6
    Last Post: 10-29-2001, 03:27 AM
  5. more with my 1st structure program
    By sballew in forum C Programming
    Replies: 42
    Last Post: 10-22-2001, 09:03 PM

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