Code:
void InsertAfter(struct list *buffer, char *newline)
{
//if currentpos is last line: I have to add....
struct node *makeNode(char *newline);
struct node *p=MALLOC(sizeof(*p));
struct node *n;
n=buffer->head;
int i;
for(i=0;i<(buffer->currentpos)-1;++i){
n=n->next;
}
printf("%s",n->line);
p->prev=n;
p->next=n->next;
n->next->prev=p;
n->next=p;
++(buffer->size);
}
What do you think now.
Now its a lot better, no segmentation faults, but the text:
Code:
The Department of Applied Mathematics is the latest academic unit of the
School of Sciences and Technology of the University of Crete. It began
operating in the academic year 1999-2000. Its mission is to provide the
appropriate educational and research infrastructure for the study of problems
arising in technological fields, natural sciences, business and economics.
The development of Mathematics has been historically linked with the
advancement of natural sciences. The ever increasing rate of
development in technology and in scientific fields such as Biology, Chemistry,
Materials, Medicine, Business and Economics have elevated the status of
Applied Mathematics to a new level. In our modern era of specialization,
the interplay and interactions between diverse scientific disciplines suggest
the study of Applied Mathematics as an efficient way for preparing scientists
capable to deal with and adapt to a rapidly changing reality.
The Department of Applied Mathematics aims to train scientists who will not
only contribute to Mathematics itself but will also have developed modelling
and computational skills and will be able to compete favourably in the job
market for highly skilled individuals. The graduates of the Department of
Applied Mathematics will have the training, knowledge and the problem solving
ability that will make them especially useful in a continuously evolving job
market. In addition, their broad scientific background will enable them to
continue post-graduate work in a wide field of applied sciences.
with a newline added before the second one, looks like this:
Code:
==> append : to filename to view the data source
The Department of Applied Mathematics is the latest academic unit of the
School of Sciences and Technology of the University of Crete. It began
@operating in the academic year 1999-2000. Its mission is to provide the
appropriate educational and research infrastructure for the study of problems
arising in technological fields, natural sciences, business and economics.
The development of Mathematics has been historically linked with the
advancement of natural sciences. The ever increasing rate of
development in technology and in scientific fields such as Biology, Chemistry,
Materials, Medicine, Business and Economics have elevated the status of
Applied Mathematics to a new level. In our modern era of specialization,
the interplay and interactions between diverse scientific disciplines suggest
the study of Applied Mathematics as an efficient way for preparing scientists
capable to deal with and adapt to a rapidly changing reality.
The Department of Applied Mathematics aims to train scientists who will not
only contribute to Mathematics itself but will also have developed modelling
and computational skills and will be able to compete favourably in the job
market for highly skilled individuals. The graduates of the Department of
Applied Mathematics will have the training, knowledge and the problem solving
ability that will make them especially useful in a continuously evolving job
market. In addition, their broad scientific background will enable them to
continue post-graduate work in a wide field of applied sciences.
What isn't written properly???