Mercurial > hg > Applications > Grep
comparison c/getWord/main.c @ 113:ffef79514d3c pairPro
add getWord
author | Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 23 Nov 2015 17:49:11 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
112:ec485345daf9 | 113:ffef79514d3c |
---|---|
1 #include <stdio.h> | |
2 #include <string.h> | |
3 | |
4 extern unsigned char* getWord(unsigned char*); | |
5 | |
6 int main(int argc, char **argv) | |
7 { | |
8 unsigned char *string; | |
9 for (int i = 1; i < argc; i++) { | |
10 if (strcmp(argv[i],"-w") == 0) { | |
11 string = (unsigned char*)argv[i+1]; i++; | |
12 } | |
13 } | |
14 | |
15 printf("input : %s\n",string); | |
16 unsigned char *word = getWord(string); | |
17 printf("word : %s\n",word); | |
18 | |
19 return 0; | |
20 } |