Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #define MAX 200
- int
- read_line(char *line) {
- int c;
- unsigned char i = 0;
- while ((c = getchar()) != EOF && i < MAX - 1) {
- line[i++] = c;
- if (c == '\n')
- break;
- }
- line[i] = '\0';
- return (i);
- }
- int
- main()
- {
- char line[MAX], word[] = "illumos";
- while (read_line(line))
- if (strstr(line, word) != 0)
- puts(line);
- return (0);
- }
Advertisement
Add Comment
Please, Sign In to add comment