Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define MAX_DEGREE 16
- #define SIZE_OF_BUFFER 4096
- #include <stdio.h>
- #include <mm_malloc.h>
- #include <memory.h>
- #include <string.h>
- #include <stdbool.h>
- FILE* fileIn;
- typedef struct {
- unsigned char* symbols;
- size_t size;
- } Template;
- typedef struct {
- unsigned char symbols[SIZE_OF_BUFFER];
- size_t size;
- } CyclicBuffer;
- void readPattern(Template* t) {
- t -> symbols = (unsigned char*)calloc(17, sizeof(unsigned char));
- if (fscanf(fileIn, "%16[^\n]s", t -> symbols) == 0) {
- printf("bad input");
- free(t -> symbols);
- free(t);
- }
- t -> size = strlen((char*)t -> symbols);
- }
- int main() {
- fileIn = fopen("in.txt", "r");
- Template* newPattern = calloc(1, sizeof(Template));
- readPattern(newPattern);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement