Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. void select(const int table[]) {
  2. int tempChar;
  3. while (tempChar <= table[3]){
  4. char* getLine;
  5. for (int i=1;i<=table[2]l;i++) fgets(getLine, 1026, stdin); //buffer size is set to 1026 to support
  6. char* temp; //a full 1024 characters-long line, '\0' and '\n'
  7. int wordCount = 1; //wordCount is used to determine the number of the column currently stored in temp
  8. temp = strtok(getLine," ");
  9. while (temp != NULL) {
  10. if ((wordCount >= table[0]) && (wordCount <= table[1])) printf("%s\n",temp);
  11. temp = strtok(NULL," "); //NULL pointer used, strtok() continues at the last successful call which is before the cycle
  12. wordCount++;
  13. }
  14. }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement