sequence points and printf()1923 (12/1/2011 6:06:21 AM) comp.lang.c OBJECTIVE: To know why its UB #include int main(void) { char c='8'; int d=8; printf("%d %d %d\n",d, d+=c>='0'&& c<='9', c++); return 0; } ================ OUTPUT =================== [arnuld@dune C]... sunrise2(598)
const qualifier and pointers726 (12/28/2011 9:05:25 PM) comp.lang.c Hi, I have to admit I don't fully understand all the implications of the const qualifier. For example, I don't understand why a pointer to a const stuff can not be compiled. const char[] foo = "a string"; cha... kpamafrederic(8)
What about namespaces ?5719 (4/3/2012 9:25:10 AM) comp.lang.c When a C program grows, the odds that two identifier names will clash will increase. So, unless the programmer has in place an effective policy to name every identifier that is able to avoid any naming clash... rui.maciel(1746)
Computed values don't tie up1425 (4/3/2012 7:29:28 PM) comp.lang.c I'm reading 'C Programming: A Modern Approach' by KN King. If I run celcius.c (as below) and enter a value of 32 (or 32.0) I am given the equivalent celcius temperature as -2.2. Surely it should be zero? /* ... rkfb(1)
Windows increments variable623 (11/2/2011 8:03:11 PM) comp.lang.c Hello, I wrote this little program: #include int main(void) { int i, f[2]; for(i = 0; i<= 2; i++) { scanf("%d", &f[i]); fflush(stdin); } if(f[0] == f[1] || f[1] == f[2] || ... bsdblack(3)
do I need strcmp ?522 (11/4/2011 10:59:48 PM) comp.lang.c I am doing a comparison here and the code works and then doesn't work. My goal is to start a string to be recognized by a function only if it starts with a +. Kind of like cpp doesn't recognize preprocess... nospam116(1187)
Sun cc: -a conflicts with -dy.347 (11/5/2011 3:48:52 AM) comp.lang.c Hello, I've got the following error when compiling a little program with Sun Forte on Solaris 9 cc -ansi -O -I/usr/openwin/include -I/usr/include/X11 -DSYSV - D_POSIX_SOURCE -D_XOPEN_SOURCE -DByteSwapped -... t.draghici(1)
OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!!8842 (11/20/2011 7:12:06 PM) comp.lang.c PROBLEM 1: COMPUTE THE EULER'S NUMBER UP TO 30 DIGITS AFTER 1. THE DIGIT REQUIRED SHOULD BE PARAMETER BY THE CALLER! PROBLEM 2: COMPUTE PI AS IN THE ABOVE! PROBLEM 3: LIST ALL PERMUTATIONS OF A STRING WITHOU... dihedral88888(786)
possible useful macros...5750 (5/23/2012 6:50:49 PM) comp.lang.c what about these macro? #define MM malloc #define FF free #define ooo cout ... io_x