Thread: Grades calculating program help please!

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User claudiu's Avatar
    Join Date
    Feb 2010
    Location
    London, United Kingdom
    Posts
    2,094
    You are calling getScores() in the print function. Remove that line.

    Does your read function work? have you tested reading from a file like I said yesterday?
    1. Get rid of gets(). Never ever ever use it again. Replace it with fgets() and use that instead.
    2. Get rid of void main and replace it with int main(void) and return 0 at the end of the function.
    3. Get rid of conio.h and other antiquated DOS crap headers.
    4. Don't cast the return value of malloc, even if you always always always make sure that stdlib.h is included.

  2. #2
    Registered User
    Join Date
    Jan 2012
    Posts
    166
    Quote Originally Posted by claudiu View Post
    You are calling getScores() in the print function. Remove that line.

    Does your read function work? have you tested reading from a file like I said yesterday?
    Yes, I just realized that and removed it.
    And yes, my read function works. I tested it yesterday and today.
    Now when I print to output file, I get student ID's and grades swapped, so everyone has A+ lol

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help! calculating grades
    By anlk5910 in forum C++ Programming
    Replies: 7
    Last Post: 10-12-2011, 04:03 PM
  2. Having problem with a program for Calculating Grades
    By Magmadragoon in forum C Programming
    Replies: 17
    Last Post: 02-15-2011, 08:21 AM
  3. calculating gpa with only grades?
    By ashlee in forum C Programming
    Replies: 8
    Last Post: 11-03-2010, 10:18 AM
  4. Calculating grades
    By Ducky in forum C++ Programming
    Replies: 0
    Last Post: 03-14-2008, 12:16 AM
  5. Replies: 13
    Last Post: 08-15-2002, 09:20 AM

Tags for this Thread