All pastes #57342 Raw Edit

Anonymous

public text v1 · immutable
#57342 ·published 2006-05-20 19:30 UTC
rendered paste body
#include <stdio.h>
#include <string.h>
#define N 20
#define M 2
void fillblanks(char *s, int x);
float calcavg(FILE *f);
void writeheadngs(FILE *f);
void writetotals(FILE *f, int n, float mo);
void get_data_from_user();
main()
{
        FILE *fp;
        char ch,*epitheto[N],*onoma[N];
        float *grade[8];
        int i;

        get_data_from_user();
        system("pause");

}


void get_data_from_user() {
  FILE *fp;
  char epitheto[N];
  char onoma[N];
  float grade;
  int i;

  fp = fopen("eisagwgi.txt", "w");

  printf("Dwse to epitheto: ");
  scanf("%s", epitheto);
  while (strcmp(epitheto, "*"))
  {
        fprintf(fp, "%s", epitheto);
        printf("Dwse onoma: ");
        scanf("%s", onoma);
        fprintf(fp, "%s ", onoma);
        for (i=0; i<M; i++)
        {
                printf("Dwse thn %di vathmologia: ", i+1);
                scanf("%f", &grade);
                fprintf(fp, "%f ", grade);
        }
        fprintf(fp, "\n");
        printf("Dwse to epitheto: ");
        scanf("%s", epitheto);
  }



  fclose(fp);

}
void fillblanks(char *s, int x)
{
      /*  int i;
        for(i=strlen(s)+1;i<x;i++)
        {
                s[i]=0'
        }*/
}
float calcavg(FILE *f)
{
}
void writeheadngs(FILE *f)
{
}
void writetotals(FILE *f, int n, float mo)
{
}