changed structure
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
#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);
|
||||
}
|
||||
Reference in New Issue
Block a user