fixed scanf-test
This commit is contained in:
parent
a37103e1fc
commit
fb0938d2c3
|
@ -50,3 +50,7 @@ modules.order
|
||||||
Module.symvers
|
Module.symvers
|
||||||
Mkfile.old
|
Mkfile.old
|
||||||
dkms.conf
|
dkms.conf
|
||||||
|
|
||||||
|
# project specific for c-basic
|
||||||
|
huffman/testfiles/*
|
||||||
|
huffman/testfiles/
|
||||||
|
|
Binary file not shown.
|
@ -1,2 +1,3 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
echo "compiling all files in working directory $(pwd)"
|
||||||
for file in $(/bin/ls); do ./compile.sh $file; done
|
for file in $(/bin/ls); do ./compile.sh $file; done
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
name=$(echo "$1" | cut -f 1 -d '.')
|
noext=$(echo "$1" | cut -f 1 -d '.')
|
||||||
gcc $1 -o bin/$noext
|
gcc $1 -o bin/$noext
|
||||||
./bin/$noext $2 $3 $4 $5 $6 $7 $8 $9
|
./bin/$noext $2 $3 $4 $5 $6 $7 $8 $9
|
||||||
|
|
15
scanf-test.c
15
scanf-test.c
|
@ -1,10 +1,11 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
int a;
|
int a;
|
||||||
float f;
|
float f;
|
||||||
char s[20];
|
char s[20];
|
||||||
scanf("%d %f %s", &a, &f, s);
|
printf("input an integer, a float, then a string.\n");
|
||||||
printf("%d %f %s\n", a, f, s);
|
scanf("%d %f %s", &a, &f, s);
|
||||||
return 0;
|
printf("%d %f %s\n", a, f, s);
|
||||||
\n}
|
return 0;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue