diff --git a/.gitignore b/.gitignore index c6127b3..61e3e7b 100644 --- a/.gitignore +++ b/.gitignore @@ -50,3 +50,7 @@ modules.order Module.symvers Mkfile.old dkms.conf + +# project specific for c-basic +huffman/testfiles/* +huffman/testfiles/ diff --git a/bin/scanf-test b/bin/scanf-test new file mode 100755 index 0000000..f9a18f0 Binary files /dev/null and b/bin/scanf-test differ diff --git a/compile-all.sh b/compile-all.sh index 6cb2257..f831cf7 100755 --- a/compile-all.sh +++ b/compile-all.sh @@ -1,2 +1,3 @@ #!/bin/bash +echo "compiling all files in working directory $(pwd)" for file in $(/bin/ls); do ./compile.sh $file; done diff --git a/compile-and-run.sh b/compile-and-run.sh index 5e72a9b..a79cf6b 100755 --- a/compile-and-run.sh +++ b/compile-and-run.sh @@ -1,4 +1,4 @@ #!/bin/bash -name=$(echo "$1" | cut -f 1 -d '.') +noext=$(echo "$1" | cut -f 1 -d '.') gcc $1 -o bin/$noext ./bin/$noext $2 $3 $4 $5 $6 $7 $8 $9 diff --git a/scanf-test.c b/scanf-test.c index 07c5bf8..8a489b8 100644 --- a/scanf-test.c +++ b/scanf-test.c @@ -1,10 +1,11 @@ #include int main() { -int a; -float f; -char s[20]; -scanf("%d %f %s", &a, &f, s); -printf("%d %f %s\n", a, f, s); -return 0; -\n} + int a; + float f; + char s[20]; + printf("input an integer, a float, then a string.\n"); + scanf("%d %f %s", &a, &f, s); + printf("%d %f %s\n", a, f, s); + return 0; +}