Thread: structs, array, code has problems, Im lost

  1. #1
    Registered User
    Join Date
    Mar 2002
    Posts
    8

    Red face structs, array, code has problems, Im lost

    The more I try to fix the worse my code gets, Please what am I doing wrong...........

  2. #2
    Registered User JasonLikesJava's Avatar
    Join Date
    Mar 2002
    Posts
    175
    What exactly is the problem (e.g. compile error?)?

  3. #3
    Registered User
    Join Date
    Mar 2002
    Posts
    203
    in void get_centre_point (Point array [ ], int MAX)
    the for loop will ALWAYS run once and only once so it really isnt a loop, and the local MAX isn't used
    Code:
    for (index = 0;  index < 1;  index++)

  4. #4
    Registered User rmullen3's Avatar
    Join Date
    Nov 2001
    Posts
    330
    I don't mean to be rude, but you have a ton of stuff in that code that is pointless, and even more that is erroneous- functions trying to access data from other functions? It would be better just to scrap it and start over, maybe read up on scope and stuff.

    You also don't need to include stdlib
    Last edited by rmullen3; 03-12-2002 at 04:08 PM.

  5. #5

    I have put in recycle bin, lol

    Well I scraped it and have did another one which actually works, My first coding for strycts, I seem to understand them now after reading a few differnt tuts. I now have a working prog.

    Thankyou I would of been there all day trying to work out the prob....

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  2. Code: An auto expanding array (or how to use gets() safely).
    By anonytmouse in forum Windows Programming
    Replies: 0
    Last Post: 08-10-2004, 12:13 AM
  3. Struct *** initialization
    By Saravanan in forum C Programming
    Replies: 20
    Last Post: 10-09-2003, 12:04 PM
  4. Help with an Array
    By omalleys in forum C Programming
    Replies: 1
    Last Post: 07-01-2002, 08:31 AM
  5. array problems
    By slamit93 in forum C++ Programming
    Replies: 7
    Last Post: 04-25-2002, 01:09 PM