Jamsa's C/C++ Programmer's Bible [Jamsa & Krander]
1500 'versets'; I've found it really useful
Type: Posts; User: moonlord
Jamsa's C/C++ Programmer's Bible [Jamsa & Krander]
1500 'versets'; I've found it really useful
erm... i'm asking because i always use
FILE* fin, fout = fopen(...);
if (!fin) return(1);
etc...
or
FILE* fin, fout;
if ((fin = fopen(...)) == NULL) return(1);
good point salem, although i personally think his next sentance was ... interesting ...
may i suggest to study the basic first?
let's see the civil war ;)
Name: Mihai (Michael)
Timezone: EST (GMT+2)
YIM: scumtk
MSNM: moonlord_antichrist
AIM: what's that?
ICQ: same for this
Skype: moonlord_owns_you
Mail: moonlord(at)retardchat(dot)org
Website:...
hope contest's still alive... sent my code to your mail...
well, just asking... i'm not using them don't worry.
i use k&r but generally add spaces in brackets, like:
if ( a ) {
(TAB STROKE)i1;
(TAB STROKE)i2;
(TAB STROKE)} else {
(DOUBLE TAB STROKE)i3;
(DOUBLE TAB STROKE)i4;
(DOUBLE TAB STROKE)}
also about obfuscated things, look at the following example:
*++b ? (*++b + *(b-1)) : 0
b-1 is calculated with b or with ++b ?
i'm just asking because i've come across some 'nice' code...
well, i found out that i++[x] is correct, but i'm still not clear about obfuscated examples. does any compiler has its rules?
from what i've heard, c transforms expr1[expr2] in *(expr1+expr2), right?
but this is madness it means that you could, for example, say:
i++[x]; // where x is a array (pointer)
seems crazy to...
from what you say i gather it's the same with Intel/Motorola
so, win32 means winapi and 32bit just means 32bit platform? interesting...
oh, i got a netinst debian so no wonder there was no library... stupid me
missed the %d out there.
the second problem: i don't argue with you, i have never actually used getchar.
i'll happily get a new compiler but:
1. don't know a thing in win32 programming
2. i gennerally try to make dos/win16/unix/linux compliant progs.
3. borlandc is the only i have. all the results of...
i use borlandc ( :eek: ) but devcpp won't work on my comp. wonder why...
1. because you only read 1 letter at once, it's 'neater' to use getchar instead.
2. printf("%d", (float)totalgrade/(float)no_of_grades); does a thing called "casting", or changing the way c treats...
well yes. but it's an ugly way of doing it.
int totalgrade;
char x, no_of_grades,i;
int main(void) {
for (i=0;i<no_of_grades;i++)
switch(x=toupper(getchar())) {
...
char, float, long, int, double, short, byte, long double... all will work
just scanf("%whatever", &grade);
well, guess i've still got to learn in c :) 10x for that. btw, how do i turn this warning on? others like "unaccesible code" and "variable is declared but never used" are on.
do dynamic allocation functions like malloc and so use the whole RAM and swap, or only 64k? the same about static allocation.
i migrated from pascal so...
i don't mind that my compiler does make it, but will you tell me what's it doing and how's right? mistifing doesn't help much...
oh, sorry, i always confuse these. so, even is when x%2==0 and odd when x%2==1? then you must read my post the other way :(
oh, by the way:
char process_com(void) {
char *i=com;
switch(com[0]) {
case 'a', 'b', 'c': {intr=com[0];break;}
default: return(1);
}
while (*++i) {
wonder i didn't see that. ask for a problem and have the solution for another
like in the ol' drinkin' song:
"100 bugs in code,
100 bugs in code,
Fix a bug, compile again,
101 bugs in code..."...