Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void select(const int table[]) {
- int tempChar;
- while (tempChar <= table[3]){
- char* getLine;
- for (int i=1;i<=table[2]l;i++) fgets(getLine, 1026, stdin); //buffer size is set to 1026 to support
- char* temp; //a full 1024 characters-long line, '\0' and '\n'
- int wordCount = 1; //wordCount is used to determine the number of the column currently stored in temp
- temp = strtok(getLine," ");
- while (temp != NULL) {
- if ((wordCount >= table[0]) && (wordCount <= table[1])) printf("%s\n",temp);
- temp = strtok(NULL," "); //NULL pointer used, strtok() continues at the last successful call which is before the cycle
- wordCount++;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement