Start development on BSD 4
[unix-history] / .ref-5cb41021d721f4e0ac572d592613f963e495d1ff / .ref-BSD-3 / usr / lib / learn / C / L11.2a
CommitLineData
fd15fd37
BJ
1#print
2With your 'cc' command you can give the name of
3an object file to be loaded with your program.
4For example
5 cc x.c y.o
6will load the previously compiled program 'y' along with
7the program 'x' to be compiled now.
8There is a file in this directory named "getnum.o"
9that contains a subroutine "getnum" that will read digits
10from the standard input, convert them to binary, and
11return an integer value.
12
13Write a program which reads an integer and prints
14it back in octal. Compile and test as usual.
15#once #create Ref
16254
17#once cp %s/getnum.o .
18#user
19a.out <Ref >test
20grep 376 test >/dev/null
21#succeed
22/* One way: */
23
24main() {
25 printf("%o\n", getnum());
26}
27#log
28#next
2911.1a 10