okay so does my code looks good?
Horrible - you are telling lies to fgets
as a result it will try to write 200 chars into buffer able to store only 132
You also return pointer to the local variable
Code:
char* getword (FILE* fp, char* result, size_t max_len)
{
return fgets(result, max_len, fp);
}
char result[132];
char* ret = getword (fp,result, sizeof result);
and because in this case your getword is just a wrapper for fgets - you can get rid of it... Or add some functionality - for example get rid of the trailing \n character as shown in the FAG