Open zeleniy opened 3 days ago
first, you have to tell the compiler, that putnumb
exists, you can do that by adding
extrn putnumb;
to the start of your main()
function.
Secondly, you have to define putnumb
somewhere, as this is not a function found in B's standard library. Maybe putnumb
isn't listed in the B reference, in that case you're welcome to implement it yourself into src/libb/libb.c
:D
Or you replace putnumb(sum)
with printf("%d*n")
. Then your program would look like:
main() {
extrn printf;
auto a, b, c, sum;
a = 1; b = 2; c = 3;
sum = a + b + c;
printf("%d*n", sum);
}
I tested this and it seems to work as expected.
Hello! I get very first example from here and get en error:
Why library function
putnumb
is undefined? What's wrong?