i am trying to add words from a text file to a linked list. my code works fine , but if the text file is too big it shows the following error: stack smashing detected. Can anyone help me please here...
Type: Posts; User: gioullis
i am trying to add words from a text file to a linked list. my code works fine , but if the text file is too big it shows the following error: stack smashing detected. Can anyone help me please here...
I want to read from file line by line without using fgets. I have the following code but in the end crashes and i can not find the what is the problem
# include <stdio.h>
# include <stdlib.h>...
How i can create file filter extension in c. For example i want the fopen function works only with files that ends with .txt extension
i used fscanf instead of strtok and problem solved. Anyway thanks guys for the help
i have changed my list_add function like this
int list_add(char *string){
struct list *curr;
char *str;
curr = (struct list *)malloc(sizeof(struct list));
str= (char...
I malloc space for the line buffer in open file and now is printing me the last character of the text file, sometimes with a couple of spaces as the elements of the list.
Where i must make a copy of...
i have a problem in my code. I want to read lines from a text file and split the line into words and save each word to a linked list. In main method first i am calling the init_list function to init...