R
Richard Tobin
[/QUOTE]Gv th mn a bnn!
Give the man a bunny?
Bunion?
-- Richard
[/QUOTE]Gv th mn a bnn!
Give the man a bunny?
Finally u got the lesson, think twice before posting.Spidey said:Thanks for all of your suggestions, and i learned a lot of thing i must
consider before posting a query in any discussion group.
It was my fault, i just typed the code and press (ctrl+f9)
(compile+make+execute) and i get that hello in my screen; without
examining anymore i posted the query which was a big mistake;
The code which is executing was not the real one................
sorry, i wont repeat it.
"Never underestimate the power of human stupidity"
Simon Biber said:#include <stdio.h>
int main(void)
{
int arr[5];
printf("%d\n", (int)sizeof arr);
printf("%d\n", (int)sizeof &arr);
return 0;
}
Borland C/C++ 5.5: 20, 20 (wrong)
Spidey said:for(;0
printf("hello");
even the condition s wrong i get a hello printed on the screen
y s this happening
Banana !
Chris said:Opinions differ.
They're certainly proper syntax. Sometimes they are also necessary.
Appendectomies are also sometimes necessary.
Richard said:jmcgill said:
Would it kill you to use curly braces?
Since a parallel reply responds negatively to your suggestion, I thought you
might welcome some support for your position.
Strange as it may seem, not everyone is an expert C programmer. A
maintenance guy in a hurry, confronted with this code:
for(image = 0; image < numimages - 1; image++)
for(y = 0; y < height; y++)
for(x = 0; x < width; x++)
if(img[image].pixel[y][x] & ALPHA)
img[image].pixel[y][x] =
alpha_blend(img[image].pixel[y][x],
img[image + 1].pixel[y][x],
img[image].alpha);
could be forgiven for adding a statement immediately under the alpha_blend
call, on the (incorrect) assumption that it would form part of the inner
loop - and he is especially likely to make this mistake if he has, say, a
Python background.
If the code were like this:
for(image = 0; image < numimages - 1; image++)
{
for(y = 0; y < height; y++)
{
for(x = 0; x < width; x++)
{
if(img[image].pixel[y][x] & ALPHA)
{
img[image].pixel[y][x] =
alpha_blend(img[image].pixel[y][x],
img[image + 1].pixel[y][x],
img[image].alpha);
}
}
}
}
that mistake would be much more difficult to make.
In my opinion, it's a good habit to get into. Obviously, some people's
mileage varies.
jmcgill said:Putting braces around statements does not cause you to lose your appendix.
But I would also like to add that in code like this:
/* ... */
}
}
}
}
}
}
Comments to indicate which block is being closed wouldn't hurt.
Spidey said:for(;0
printf("hello");
even the condition s wrong i get a hello printed on the screen
y s this happening
Simon said:Turbo C is known to be buggy.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.