Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char * getline(FILE * fi,size_t line_length,size_t line_number)
- {
- size_t i;
- char * aux_string;
- char * p;
- if (fi==NULL)
- return NULL;
- if ((aux_string = malloc(line_length*sizeof(char)))==NULL)
- return NULL;
- i=0;
- while(fgets(aux_string,line_length,fi)!=NULL||feof(fi)!=0)
- {
- if (i==line_number)
- {
- if ((p=strchr(aux_string,'n'))!=NULL)
- {
- *p='