# HG changeset patch # User ichikitakahiro # Date 1617094486 -32400 # Node ID d00ec1274f2336c339bf733b345b0f4ef90932bc # Parent c5c3e9f1533a45d3d45d95ba6352bb13109ef5d0 add fgets diff -r c5c3e9f1533a -r d00ec1274f23 src/parallel_execution/examples/wc/WcImpl.cbc --- a/src/parallel_execution/examples/wc/WcImpl.cbc Thu Mar 18 10:49:58 2021 +0900 +++ b/src/parallel_execution/examples/wc/WcImpl.cbc Tue Mar 30 17:54:46 2021 +0900 @@ -3,13 +3,6 @@ #impl "Wc.h" as "WcImpl.h" #interface "WcResult.h" -// ---- -// typedef struct WcImpl <> impl Wc { -// char* Keyword; -// int wordNum; -// } WcImpl; -// ---- - Wc* createWcImpl(struct Context* context, char* filename) { struct Wc* wc = new Wc(); struct WcImpl* wc_impl = new WcImpl(); @@ -47,6 +40,14 @@ Count char TODO */ + int N = 256; + char str[N]; + int line = 0; + while(fgets(str, N, wc->file)!=NULL){ + printf("%s",str); + line++; + } + printf("line = %d", line); goto countUp(wc, next); }