jackba / wy-internal-system

Automatically exported from code.google.com/p/wy-internal-system
0 stars 0 forks source link

Helen's C program curriculum #38

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Steps into C:
Note:Giggs should read the exams first.
1.Computer basic concept:CPU,hard disk,memory,I/O,displayer.(10m)
2.How computer calculates.(10m)
3.What can C direct CPU to do.(10m)
4.C program demo.(30m)
5.C syntax.(days to repect concepts)
6.exams and experiments.(days for Helen to take and Giggs to teach)

Original issue reported on code.google.com by Giggs...@gmail.com on 19 Jun 2013 at 3:56

GoogleCodeExporter commented 9 years ago
void AppendAnnouncement(structAnnouncement *p, int count)
{
    FILE *fp = NULL;
    if ((fp = fopen("C:\\Giggs\\Project\\CWD3\\GFC\\DB\\Debug\\xat.db", "ab+")) == NULL)
    {
        printf("Can't open file.\n");
        return;
    }

    fseek(fp, - sizeof(int), SEEK_END); //SEEK_END
    int len = 0;
    fread(&len, sizeof(int), 1, fp);
    printf("%d\n", len);
    len = 138;
    fseek(fp, 0, SEEK_CUR);
    size_t t =  fwrite(&len, sizeof(int), 1, fp);
    printf("%d\n", t);
    fseek(fp, - sizeof(int), SEEK_END); //SEEK_END
    fread(&len, sizeof(int), 1, fp);
    printf("%d\n", len);

    //fseek(fp, 0L, SEEK_END);
    //fwrite(p, sizeof(structAnnouncement) * count, 1, fp);

/**/
    /*
    int len = 138;
    fseek(fp, - sizeof(int), SEEK_END); //SEEK_END
    fwrite(&len, sizeof(int), 1, fp);
    */
    /*
    fseek(fp, - sizeof(int), SEEK_END); //SEEK_END
    int len = 0;
    fread(&len, sizeof(int), 1, fp);
    printf("%d\n", len);*/

    fclose(fp);
}

Original comment by Giggs...@gmail.com on 6 Sep 2013 at 9:48

GoogleCodeExporter commented 9 years ago

Original comment by Giggs...@gmail.com on 17 Sep 2013 at 12:39

Attachments: