C Standard Library oddity
1
Name:
Anonymous
2008-06-25 9:12
int fputc(int c, FILE *stream);
So why does fputc take an integer when it writes an unsigned char?
Believe it or not, I actually had a fucked up program because of this and it took so long to get it right because I couldn't understand what was wrong.
2
Name:
Anonymous
2008-06-25 9:32
▄▀▀▀▀▀▀▀█████▄ ▀▀▀▀▀██████▄ ▀▀█████▄ ▀▀▀▀▀▀█████████▄ ██▄ ▄▀▀████▄
█ ▀▌▀██ ▐▀ ▀███ ▐▀ ▀██ ▀▌ ▀▀████ ██ █ ▐ ▀██
█ ▐█ ▄▄ ▀██ ▐█ ▀▐█ ▐█ █ ▐█
▓ ▄▄▄▄▄▄▀ █ █ ▐▓ ▓ ▄▄ ▄▄▄▄▄▀ █ █ ▓
▒ █ ▀▀▀▀ ▒ ▒ ▒ ▒ ▄ ▀▀ ▒
░ ▀▀▀▀▄ ░ ░ ░ ░ ░ ░
░ ▀ ▄▄ ░ ░ ░ ░ ░ ▄▄ ░
░ ▄▀▀▀▀ █ █ ░ ░ ░ ░ ░ ░ ░ ░
▒░ ░▓ ░░ ░█ █░ ░▒ ░▒ ▒░ ░▒ ▒░ ░▒ ▒░ ░▒
▓▒░ ░▒▒ ▒▒░ ░▒█ █▒░ ░▒▓ ░▒▓ ▓▒░ ░▒▓ ▓▒░ ░▒▓ ▓▒░ ░▒▓
█▓▒░░▒▓▓ ▓▓▒░░▒▓█ █▓▒░░▒▓█ ░▒▓█ █▓▒░░▒▓█ █▓▒░░▒▓█ █▓▒░░▒▓█
▀▀▀▀▀▀ ▀▀▀▀▀▀ ▀▀▀▀▀▀ ▀▀▀▀▀▀ ▀▀▀▀▀▀ ▀▀▀▀▀▀ ▀▀▀▀▀▀
3
Name:
Anonymous
2008-06-25 9:44
It's for type compatibility with getchar , which returns an int rather than unsigned char so it can include negative numbers for exceptions like EOF.
4
Name:
Anonymous
2008-06-25 9:46
Compatibility with getc , I mean.
5
Name:
Anonymous
2008-06-25 9:50
▄▀▀▀▀▀▀▀█████▄ ▀▀▀▀▀██████▄ ▀▀█████▄ ▀▀▀▀▀▀█████████▄ ██▄ ▄▀▀████▄
█ ▀▌▀██ ▐▀ ▀███ ▐▀ ▀██ ▀▌ ▀▀████ ██ █ ▐ ▀██
█ ▐█ ▄▄ ▀██ ▐█ ▀▐█ ▐█ █ ▐█
▓ ▄▄▄▄▄▄▀ █ █ ▐▓ ▓ ▄▄ ▄▄▄▄▄▀ █ █ ▓
▒ █ ▀▀▀▀ ▒ ▒ ▒ ▒ ▄ ▀▀ ▒
░ ▀▀▀▀▄ ░ ░ ░ ░ ░ ░
░ ▀ ▄▄ ░ ░ ░ ░ ░ ▄▄ ░
░ ▄▀▀▀▀ █ █ ░ ░ ░ ░ ░ ░ ░ ░
▒░ ░▓ ░░ ░█ █░ ░▒ ░▒ ▒░ ░▒ ▒░ ░▒ ▒░ ░▒
▓▒░ ░▒▒ ▒▒░ ░▒█ █▒░ ░▒▓ ░▒▓ ▓▒░ ░▒▓ ▓▒░ ░▒▓ ▓▒░ ░▒▓
█▓▒░░▒▓▓ ▓▓▒░░▒▓█ █▓▒░░▒▓█ ░▒▓█ █▓▒░░▒▓█ █▓▒░░▒▓█ █▓▒░░▒▓█
▀▀▀▀▀▀ ▀▀▀▀▀▀ ▀▀▀▀▀▀ ▀▀▀▀▀▀ ▀▀▀▀▀▀ ▀▀▀▀▀▀ ▀▀▀▀▀▀
6
Name:
Anonymous
2008-06-25 10:23
>>5
Ar good idea, its probs gona butcher it but i wana get it done lol
7
Name:
Anonymous
2008-06-25 10:40
,'``.._ ,'``.
:,--._:)\,:,._,.:
:`~-,'' :`.~.';\ HAVE YOU READ
`,' `---' `. YOUR SICP TODAY?
/ :
/ \
,' :\.___,-.
`...,---'``````-..._ |: \
( ) ;: ) \ _,-.
`. ( // `' \
: `.// ) ) , ;
,-|`. _,'/ ) ) ,' ,'
( :`.`-..____..=:.-': . _,' ,'
`,'\ ``--....-)=' `._, \ ,') _ '``._
_.-/ _ `. (_) / )' ; / \ \`-.'
`--( `-:`. `' ___..' _,-' |/ `.)
`-. `.`.``-----``--, .'
|/`.\`' ,',');
8
Name:
Anonymous
2008-06-25 10:48
'-._ ___.....___ ___,,,,,___ _,-'
`.__ ,-' ,-.`-, .-`,-. '-. __,`
`''-------' ( p ) `._ _,` ( q ) '-------''`
`-' \ / '-`
\ /
. \ / ,
\---..,--' '--.,,---/
................._ --...--, .--,,,-- _,,,,,,,,,,,,,,,,,
`-.._ _.-' '-,_ _,,-`
`'-----'' ''-----'`
9
Name:
Anonymous
2008-06-25 11:01
.
@
@ \ ,
/ ,'``.._ ,'``.
\ . :,--._:)\,:,._,.:
, , :`~-,'' :`.~.';\
'-._ ___.....___ / `,' `---' `.
`.__ ,-' \-/`-, / :
`''-------' ( @ ) `._ / \
>-> \ ,' :\.___,-.
\ `...,---'``````-..._ |: \
. \ ( ) ;: ) \ _,-.
\---..,--' `. ( // `' \
................._ \,'..--, : `.// ) ) , ;
`-.._ ||_.-' ,-|`. _,'/ ) ) ,' ,'
`'-----'' ( :`.`-..____..=:.-': . _,' ,'
|| `,'\ ``--....-)=' `._, \ ,') _ '``._
|| _.-/ _ `. (_) / )' ; / \ \`-.'
/\ `--( `-:`. `' ___..' _,-' |/ `.)
`-. `.`.``-----``--, .'
|/`.\`' ,',');
10
Name:
Anonymous
2008-06-25 15:24
Newer Posts