main(int argc, char *argv[]){ printf("-----------------Question Two--------------\n"); FILE *in; char *t; in = fopen(argv[1],"r"); if (in == NULL) printf("No Memory Left\n"); t = read_a_tag(in); printf("First tag is : %s\n",t); }
main(int argc, char *argv[]){ char *t; t = "test"; char *d = ReverseCopy(t); printf("Reversing String now\n"); printf("String:%s\n",d); printf("-------------Question 2--------------\n"); stackADT stack = NewStack(); FILE *in; //char *test = (char *)malloc(256*sizeof(char)), *test2 , *t1; int tM; char *test, *test2 , *t1; int tM; in = fopen("webpage.html","r"); if (in == NULL) printf("Null File my n***a\n"); string t1 = read_a_tag(in); string t2 = read_a_tag(in); /* if (tag_match(read_a_tag(in),read_a_tag(in))){ printf("Testing double method calls\n"); } else{ printf("Did not work\n"); } */ test = read_a_tag(in); printf("Testing read_a_tag method, tag:%s \n",test); test2 = read_a_tag(in); printf("Testing read_a_tag method, tag:%s \n",test2); tM = tag_match(test,test2); printf("Did these tags match?:%d\n", tM); test = read_a_tag(in); t1 = (char *) malloc(strlen(test) * sizeof(char)); if (t1 == NULL) printf("No Memory\n"); t1 = test; printf("Testing read_a_tag method, tag:%s \n",t1); test2 = read_a_tag(in); printf("Testing read_a_tag method, tag:%s \n",test2); tM = tag_match(t1,test2); printf("Did these tags match?:%d\n", tM); fclose(in); }