Thread: Football League Program

  1. #1
    Registered User
    Join Date
    Jan 2013
    Posts
    5

    Football League Program

    Hi Guys

    Ive got a football league program that I made to handle 10 teams. Ive got the 10 teams and it displays the league with 0 for played, won, drawn, lost and points but im having trouble actually adding matches to this? How do i add matches and update the team struct?


    My program is here in PDF format.
    Program.pdf

  2. #2
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    All that has is the way to enter 10 team names. It shows the results, but they are initially set to all zeroes.

    Look for another part of the program to enter the games results.

  3. #3
    Registered User
    Join Date
    Jan 2013
    Posts
    42
    You will have problem if user enters Manchester United for team. Then you will have two teams, one called Manchester and other called United, which you probably don't want. It happens because %s scans everything until blank space.Try to fix it:

    Code:
            printf("\nEnter Team:");
            scanf("%s",leagueteams[t].name);
    Do you want your program to generate all games, or do you want from user to enter information about game? In each case, you would like to create new function which does that.

  4. #4
    Registered User
    Join Date
    May 2012
    Posts
    1,066
    Quote Originally Posted by cgod1234 View Post
    My program is here in PDF format.
    Why don't you copy'n'paste your code as plain text and put it between code-tags as everybody else does? Look at Posting Code? Read this first!
    If it is too big, try to reduce it so that it still shows your problem.

    Bye, Andreas

  5. #5
    Registered User
    Join Date
    Jan 2013
    Posts
    5
    Yeah I want the user to input the team scores so then the table updates automatically

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. league table
    By ingeniousreader in forum C Programming
    Replies: 6
    Last Post: 02-29-2012, 01:54 PM
  2. How to program a "soccer league fixture"?
    By Awareness in forum C Programming
    Replies: 2
    Last Post: 02-13-2012, 07:58 PM
  3. league table
    By ingeniousreader in forum C Programming
    Replies: 5
    Last Post: 02-04-2012, 07:25 AM
  4. Replies: 4
    Last Post: 02-26-2009, 08:44 PM
  5. Football team league need help to make this work
    By wurzull in forum C Programming
    Replies: 1
    Last Post: 04-07-2007, 07:35 AM