By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,898 Members | 2,039 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,898 IT Pros & Developers. It's quick & easy.

C By Dissection Chapter 12 Exercise 6

P: 17
I am wondering if someone can help me with the following C programming problem.

I am trying to develop a program dealing with structures and ADTs.

I am trying to develop a program that prints the average for each student in a class. Let an A grade have a value of 4, a B grade have value 3, and so forth.

I have develop the following modules, cl_info.h and main.c, but am experiencing errors.


#include <stdio.h>

#define CLASS_SIZE 100
#define NCOURSES 10 /* number of courses */

struct student {
char *last_name;
int student_id;
char grades;

struct date {
short day;
char month[10];
short year;

struct personal {
char name[20];
struct date birthday;

struct student_data {
struct personal p;
int student_id;
char grades[NCOURSES];


int main(void)
struct student temp, class[CLASS_SIZE];

read_grades (temp.grades)


void read_grades(char g[])
int i;

printf(“Enter %d grades: “. NCOURSES);
for (i = 0; i < NCOURSES; ++i)
scanf(“ %c”, &g[i]);

Please help me, if you can.

Thank you.
Sep 26 '06 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.