aboutsummaryrefslogtreecommitdiff
path: root/tests/files.cpp
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2011-07-12 07:43:52 -0700
committerAlon Zakai <alonzakai@gmail.com>2011-07-12 07:43:52 -0700
commit2a0f3ba46616262a3b643bf8927363a320118f3f (patch)
tree09578a3e974abdc486eadf3c16ab6dd95647ab0f /tests/files.cpp
parent8f49ea85f58d173db398e8b87f3e4ea89a79a87b (diff)
fscanf
Diffstat (limited to 'tests/files.cpp')
-rw-r--r--tests/files.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/files.cpp b/tests/files.cpp
index 1167bbdf..6283c4f1 100644
--- a/tests/files.cpp
+++ b/tests/files.cpp
@@ -76,6 +76,19 @@ int main()
fclose(other);
+ // fscanf
+
+ outf = fopen("fscan.f", "w");
+ fprintf(outf, "10 hello");
+ fclose(outf);
+
+ int number;
+ char text[100];
+ inf = fopen("fscan.f", "r");
+ num = fscanf(inf, "%d %s", &number, text);
+ fclose(inf);
+ printf("fscanfed: %d - %s\n", number, text);
+
return 0;
}