It gets the job done, but cannot make a large codebase DRY without insanity.
It is interesting to note how late C appeared: 1972, compared e.g. to Fortran which is from 1957. This is basically because C was a "systems programming language", i.e. with focus on pointer manipulation, and because early computers were so weak, there was no operating system or many software layers in the early days. Fortran however was a numerical language, and it ran directly on bare metal, an application that existed before systems programming.
Examples under c.
A closed standard: stackoverflow.com/questions/81656/where-do-i-find-the-current-c-or-c-standard-documents. Nice.
Quick overview at stackoverflow.com/questions/1780599/what-is-the-meaning-of-posix/31865755#31865755
Exmples under c/posix:
- c/posix/signal_return.c: stackoverflow.com/questions/37063212/where-does-signal-handler-return-back-to
- c/posix/inet/pton.c:
inet_pton
demo. Adapted fromman inet_pton
on Ubuntu 23.04. Usage:Output:./pton.out 192.187.1.42
So we see that the strings was converted to an integer, e.g.:0xc0bb012a
See also: stackoverflow.com/questions/1680622/ip-address-to-integer-c/76520978#76520978- 0xc0 = 192
- 0xbb = 187
- 0x01 = 1
- 0x2a = 42
- c/posix/inet/ntop.c:
inet_ntop
demo. Adapted fromman inet_pton
on Ubuntu 23.04. Usage:Output:./ntop.out 0x01021AA0
./ntop.out 0x01021AA0
Articles by others on the same topic
There are currently no matching articles.