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.
>>40
1. open Pastebin.com
2. post errors in a new pastebin.
2. post source code in new pastebin.(if its not possible, post the relevant functions and their immediate places within main)
The thing is simple: the part i posted doesnt work, everything else does.
Everything i posted is everything thats wrong right now, there is no shit before this and gcc does not print any errors in main().
I have like a lot of shit in my project folder, and most of my code is fucking ugly and buggy in such ways that i would shame myself in the ground if anyone saw it, but it still somewhat works, tested it like a thousand times.
Still want me to post it?
Name:
FrozenVoid2010-07-06 15:41
>>44
Post it anyway, it not like you signed every line with Joe Coder Random(c) GPL
>>47
This reminds me of the story of the shy girl. All her friends wanted her to sing for some reason, and she was all "no i'm terrible :3" and they were insistent. Eventually, when their attention was elsewhere, she plucked up the courage to sing. One of them noticed and told the others to shut up.
She sounded like a diseased macaw. Nobody spoke of that moment again.
Couple advices:
1. Stick to straight C until your program runs perfectly.
2. Only introduce asm blocks to optimize inner loops/functions.
3.use only complete, tested assembler subroutines and have a fallback for normal C-only operation.
4.Don't develop software out of your league(OS/Drivers/etc)
__________________
Orbis terrarum delenda est
>>61
And thus the physical representation of cdr is in fact an African American smoking weed every day.
Name:
Anonymous2010-07-06 16:25
OP here.
>>59
Good advice but too late.
Thank you for that library link you posted, sure will be helpfull for me.
Also thanks to anonymous.
Its already late here and have too take a bath. I will try haxing this thing until it works somewhat.
I hoped i could resolve this fast with /prog/s help and that you could laugh at this silly thing, but seems isnt the case.
I will check out this thread in the morning, to see if it has been threadstoped, if you guys are interested in the src, let me know so i can tidy up a bit and post it.