Web Page - http://www.cs.tau.ac.il/~efif/courses/Software1_Spring_04
The auto. check of exersice 2.4 (rec_string) is going to be repeated with a larger set of test cases, and its grade will change accordingly.typedef struct soldier { int id; char name[64]; char *rank; } Soldier; int main() { Soldier s0, s1, s2 = {5705706, "Enzo Agada", "General"}; s0.id = 5705705; strcpy(s0.name, "John Dow"); /* incorrect: s0.name = "John Dow"; */ s0.rank = "Captain"; /* uncorrect: strcpy(s0.rank, "Capitan"); */ s1 = s0; printf("%d %s %s\n", s0.id, s0.name, s0.rank); printf("%d %s %s\n", s1.id, s1.name, s1.rank); printf("%d %s %s\n", s2.id, s2.name, s2.rank); } |
5705705 John Dow Captain 5705705 John Dow Captain 5705706 Enzo Agada General |
FILE * fopen (const char * filename, const char * mode); |
int fclose (FILE * stream); |
int fseek ( FILE * stream , long offset , int origin ); |
long ftell ( FILE * stream ); |