28 lines
498 B
C
28 lines
498 B
C
#include "stringchicken.h"
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
|
|
int main(int argc, char* argv[]) {
|
|
char myString[100];
|
|
char ch;
|
|
FILE *fptr = fopen(argv[1], "r");
|
|
|
|
if (fptr == NULL) {
|
|
printf("file doesn't exist");
|
|
exit(1);
|
|
}
|
|
|
|
struct stringchicken *mystringarray = create_string_chicken();
|
|
|
|
while (fgets(myString, 100, fptr)) {
|
|
push_SC(myString, mystringarray);
|
|
}
|
|
|
|
print_SC(mystringarray);
|
|
int mylength = strnlen(myString, 100);
|
|
|
|
fclose(fptr);
|
|
}
|