Initialiazing a malloced struct to all-0238 (4/25/2013 3:10:55 PM) comp.lang.c Hello everyone,
Typically when I want to initialize an auto struct to
"all-0" values, I write
struct foo bar = { 0 };
and let the compiler correctly set arithmetic values
to the appropriate 0 or 0.... Noob
I need your advices about C prg.8012 (4/24/2013 7:30:01 PM) comp.lang.c Hi there!
Firstly, sorry for my bad English :/
I'm only 17 and I want to learn C and write perfect codes in C. I'm not so good in C programming, but I want to become a good C programmer.
My English i... dg282828(7)
Why does write() to stdin work?364 (4/23/2013 1:59:59 PM) comp.lang.c Tried the following code under gcc and it writes to stdin??
#include
#include
int main()
{
int k;
for(k= 0; k < 4; k++)
write(k, "Hello world!\n", 13);
}
Any poiners?
-ishwar
... ishwar.rattan(8)
Optimizing pow() function505 (4/22/2013 3:23:51 PM) comp.lang.c I have a simple (16-bit) embedded platform and I have to make the following calculations.
unsigned int
func(unsigned int adc, unsigned int pwr, unsigned int pt, double exp) {
return (unsigned int)(pow((d... pozzugno(150)
Who can explain this bug?5832 (4/17/2013 7:49:50 PM) comp.lang.c Platform: gcc 4.6.3 on AMD Athlon(tm) II X2 245 Processor on
Ubuntu 12.04
The bug I thought was due to a particularly hard to find memory access
problem (see other thread I started today) seems to be even... dmathog(163)
Help with printing a bit pattern with printf and %x1031 (4/17/2013 5:19:50 AM) comp.lang.c I'm trying to show how floating point numbers are represented internally. =
I thought the easiest way would be to print the same floating point number =
once with %f and then again with %x, but the results s... Matt.Jaffe(6)
Writing through an unsigned char pointer2016 (4/11/2013 1:52:22 PM) comp.lang.c Hello,
Is the following code valid:
static void foo(unsigned char *buf)
{
int i;
for (i = 0; i < 16; ++i) buf[i] = i;
}
void bar(void)
{
unsigned long arr[4];
foo(arr);
}
The compile... Noob
GCC warnings for comma operator1812 (4/10/2013 11:07:14 PM) comp.lang.c Recently I wrote a macro to set a bit field at an arbitrary location in an =
array of some unsigned integral type. (Can't show it because it's propriet=
ary.) The bit field is specified as a bit offset from... wkaras(191)
difference between pointers4641 (3/30/2013 3:36:42 PM) comp.lang.c hello all,
I get this doubt about this behavior of C.
consider the following code.
int a,b,d1,d2,diff;
d1= &a;
d2 = &b;
diff = &a-&b;
printf("\nDifference between address: %d", diff);
diff = d1-... tewari.varun(18)