I know that pagination is splitting up a text document which is being presented to the user based upon the amount of characters which can be placed on the screen. I wasn't looking for a code solution I was just looking for a point in the correct direction like trying a list with a counter. Or read it all first break the text into arrays and print the arrays. I've been trying this for the past week, and was in need of a fresh idea to try. Sorry I tried to get some help.

I am currently working on implementing an operating system in turbo c which uses c as the programming language. For this project we must implement pagination. I have absolutely no idea how to do this in c and most web results are for web pages using mySQL or java or css etc. Does anyone know how to do this?

Thanks for the help and the warning have no idea what code tags are

well this is what i have come up with so far. This is the first step of the process separating my main array into two separate arrays this must be done two more times to ultimately get to 8 arrays of 100 numbers. When the program comes back around to the parents the information must be merged together. If this is correct and someone could provide a little help how to proceed down the layers.

[CODE]for(i = 0; i < 2; i++){// creating two children from the parents
if(child_pid=fork()<=0)
break;

if (child_pid==0 && n ==0)// first child
{
    printf("Current Process PID: %ld, Parent PID:%ld \n",
      (long)getpid(), (long)getppid());
    for(i = 0; i <400; i ++)
    {
        array1[i] =  main_array[i];
    }//end for
    printf("%ld: 400 numbers stored\n", (long)getpid());
    n = 1;
}//end if
else if(child_pid == 0 && n == 1)//second child
{
    int array12[400];
    printf("Current Process PID: %ld, Parent PID:%ld \n",
      (long)getpid(), (long)getppid());
    for(i = 400; i <800; i ++)
    {
        array12[i] =  main_array[i];
    }
    printf("%ld: 400 numbers stored\n", (long)getpid());
}//end else if
else //parent
{
    wait(NULL);

}//end else
}// end for[/CODE]

So far this is my code when dealing with the parents and children I don't think this is even close to right but for the assignment we have to break it down into 8 different arrays containing 100 numbers each sort them and go back through and merge all the numbers together. The print statements are also required for each move we make we must print out the current pid and the parent pid. Currently this won't even compile with errors of undefined reference to getppid and fork.

child_pid=fork();
if (child_pid<0)
{ printf("Failed to fork\n"); exit(-1); }

printf("Current Process PID: %ld, Parent PID:%ld \n",
(long)getpid(), (long)getppid());
readFile(file_name);
printf("%ld 800 numbers stored\n", (long)getpid());
printf("%ld Creating Child processes", (long)getpid());

child_pid=fork();
if (child_pid<0)
{ printf("Failed to fork\n"); exit(-1); }

for (i=0; i<1; i++){
if (child_pid=fork() <= 0)
break;

printf("Current ProcessID: %ld, Parent ID:%ld \n",
(long)getpid(), (long)getppid());
printf("%ld 400 numbers stored\n", (long)getpid());
printf("%ld Creating Child processes",(long)getpid());
}//end for

I was asked to write a program, based on parent-child cooperation, which uses a “parallel” merge sort to a sequence of 800 numbers from a text file.I have to read the sequence of 800 integers, which I store in an array, and then pass half of them to a child, and the other half to the second child of the parent class. I have to do this until only 100 numbers are left in each child. When I have reached this the numbers must be sorted, which I am doing using a bubble sort.Once these are sorted the must be returned to the parent processes and merged creating one sequence of sorted numbers. The final sequence must be stored in a file. The splitting of the parent must be done using fork(). I have no idea how to manipulate the parent and child relationship to do splitting and then once again merging. I am not looking for an answer but help on how to do this anything would be great.

I am currently working on a project where we must read in a file and then print it back type justified. There must also be a specific number of characters per line based upon user Input with the extra characters being distributed spaces. I am reading in each character from the file storing them individually in an array and then placing the whole word into the linked list(I believe). I am not very experienced with C/C++ so I am not sure I am doing this correctly. I have printed the strings which I believe are being fed into the list and mostly they print as expected but occasionally there is random stuff at the end of the word aka diamond becomes diamondssjkd with the extras being random characters or symbols. The biggest problem I am having(if the words are being read in correctly) is coming up with a method which prints the words right now I am just printing either blank spaces or one letter.Here is my code.

[CODE]#include <stdio.h>

include <stdlib.h>
include <string.h>

struct listNode { / self-referential structure /
char data;
struct listNode
nextPtr;
};

typedef struct listNode LISTNODE;
typedef LISTNODE *LISTNODEPTR;

void readfile();
void insert(LISTNODEPTR ,char );
void deleteList(int count, char *);
void printList(LISTNODEPTR,int c);
int isChar(char);

main()
{
int charPerLine = 0;
readfile();
printf("How many characters between 55 and 80 per line? \n");
scanf("%d", &charPerLine);
while(charPerLine > 80 || charPerLine < 55){
printf("The character you entered was not in the specified range try again.\n");
printf("How many ...