what is wrong with my program? its supposed to process arguments but it doesnt.
void output(char *fuckyou);
int main(int argc, char **argv) {
int i;
for(i = 0; i < argc; i++) {
output("SHIT");
}
}
>>4
Learn C please. >>1
How about you do something with i, argc or argv (i.e. process them) instead of just output()ting "SHIT" for each one?
That's why it's not processing them. Because you didn't tell it to.
Name:
Anonymous2010-07-06 13:14
>>6
The SHIT thingy is just a placeholder, it desnt even enter the loop, that is my problem
Name:
Anonymous2010-07-06 13:20
I compiled my program without libc, is that a problem?
Here's a hint: if you want people to troubleshoot your code, post all of your code instead of just the bit you think is fucking up. You didn't manage to figure out the problem on your own, so chances that you'll be able to successfully identify the right bits of code to post yourself aren't that great.
>>22
Random guess: your output function. Or a return or exit before the loop. Or something that clobbers the value of argc before the loop.
You shouldn't have ``a LOT of code'' if tracking down a problem like this is beyond you.
Hey is there any reason that Allegro's masked_blit() suddenly fails to transparentize 255,0,255?
Cool thread btw.
Name:
FrozenVoid2010-07-06 14:44
void masked_blit(BITMAP *source, BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height);
Like blit(), but skips transparent pixels, which are marked by a zero in 256-color modes or bright pink for truecolor data (maximum red and blue, zero green), and requires the source and destination bitmaps to be of the same color depth. The source and destination regions must not overlap. Example:
BITMAP *hud_overlay;
...
/* Paint hud overlay on the screen. */
masked_blit(hud_overlay, screen, 0, 0, 0, 0,
hud_overlay->w, hud_overlay->h);
If the GFX_HW_VRAM_BLIT_MASKED bit in the gfx_capabilities flag is set, the current driver supports hardware accelerated masked blits from one part of the screen onto another. This is extremely fast, so when this flag is set it may be worth storing some of your more frequently used sprites in an offscreen portion of the video memory.
Warning: if the hardware acceleration flag is not set, masked_blit() will not work correctly when used with a source image in system or video memory so the latter must be a memory bitmap.