fixed scanf-test

This commit is contained in:
Christoph J. Scherr 2022-11-24 21:39:41 +01:00
parent a37103e1fc
commit fb0938d2c3
5 changed files with 14 additions and 8 deletions

4
.gitignore vendored
View File

@ -50,3 +50,7 @@ modules.order
Module.symvers
Mkfile.old
dkms.conf
# project specific for c-basic
huffman/testfiles/*
huffman/testfiles/

BIN
bin/scanf-test Executable file

Binary file not shown.

View File

@ -1,2 +1,3 @@
#!/bin/bash
echo "compiling all files in working directory $(pwd)"
for file in $(/bin/ls); do ./compile.sh $file; done

View File

@ -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

View File

@ -4,7 +4,8 @@ int main() {
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;
\n}
}