| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8
Comments:
<0> http://rafb.net/paste/results/gq3IYl92.html <1> you're first while loop moves s1 to the end, why? <1> oh <1> wait <1> strcat <1> not copy <1> my bad <0> i get segmentation fault <0> :( <1> thats because theres no memory allocated for the string you're adding to s1 <1> you have to allocate the size of s2 to s1 <1> ie <0> is that the only reason? <1> yeah <1> s1 = "thats" <1> s2 = "cool"
<1> only 6 "memory units" are reserved for s1, "thats" and the \0 <0> yeah <1> cool <0> oh, and i should put a '\0' at the end of my strcat too <1> didn't knew if you knew or not <1> I'd think so <2> frutXcake: you will want to save the location of s1 and restore it to that location prior to returning it, otherwise you are returning an empty string <1> good point pfloyd, missed that :D <0> yup <0> pfloyd: but otherwise does it look ok? <0> becausae memory allocation, i can do that within the main() function it hink <2> frutXcake: you need to add (at the top): char *tmp = s1; then at the end before the return: *s1 = '\0'; s1 = tmp; but otherwise yes <3> wow, aparently frutXcake is a super **** head, nice! <0> LordZid: shhhh! <0> what are you doing whois'ing me? <0> are you a stalker? <2> frutXcake: are you working through the K&R book? <0> ahh tmp being the start of the character <0> i mean start of the string <0> yeah i am <0> this book is great.. old, but great <0> are ther answers to these exercises? <4> yes, 42. <2> yes, you need to save a pointer to s1 since you are modifying s1. an alternative would be to set tmp = s1; then modify tmp throughout the function, then just return s1 <2> frutXcake: I believe there some on the web, yes. <0> now im gonna try to write an array version <0> probably harder <0> wel, not harder, but annoying <0> pointers sort people out quickly.. im at uni and about half the cl*** dropped out because they couldnt understand pointers <0> then memory allocation came.. :( <0> paging throws the hell out of me <0> my pointer strcat implementation though.. there mustr be a quicker way of doing it? <0> or is that quick enough? <0> haha look at this code <0> http://en.wikipedia.org/wiki/Obfuscated_C <5> what's so amusing about that code? <0> nothing sir <4> hehe thats messed up. <0> see? rip finds it funny <0> lighten up e-geek <5> that code isn't even that obfuscated, though. <3> not really <3> I'm not sure it even *is* <5> look at what the _ macro does. if -F >= 00, then subtract one from F and one from OO. <1> obfusticated would be #defining every number to be another one <1> it also would be stupid <3> it just makes the source EASIER to read <3> which is *not* the point <6> Humanoid: you can't redefine numbers <7> even in c++ you can't redefine numbers <1> aww :( <6> yeah, you need perl for that. yay for overloaded literals! <1> I hardly ever use the preprocessor <1> it would make sense they're reserved though <6> ObObfu: http://mauke.ath.cx/stuff/c/ifalse.c <1> pl/1 had no reserved keywords at all apparently, so you could call a variable if, and ***aign a value to it, then do if if = if, if = 2 <7> what's simple and portable way to calibrate/calculate cpu e time in C ? <7> the register_int_var++; is supposed to be 1 cycle <7> but what if ****en compuler omtimize it out ? <1> turn off optimization <8> Mish_: um.. two words: cpu time sharing.
<7> cpu shame taring ? <7> what's that ? <7> ah, it's two words <7> Alipha: that's why you divide by cpu time, not by elapsed time <4> isnt that 3 tho? <9> is there a way to list the fd's that are set in a fd_set ? <8> rip: part of the humor. i originally was going to use 2 words, but then i inserted "time" in there <7> Caligo: loop+FD_ISSET() <9> ok <9> thx <10> hullo <10> hmmm... <11> hi MarkT <10> I can't find any sellers on ebay that are selling tv's in my city... <10> I was really hoping I wouldn't have to add shipping charges to it... <11> are there any cl***ified ads in your area in the paper or online? is craigslist.com available in your area? <10> OT: It has to be off ebay. <10> OT: the prize is in ebay gift certificates. <11> http://geo.craigslist.org/iso/ca <11> MarkT-, ohh.. that's too bad <10> if I actually had the cash I would just head down to futureshop and buy one that way. <12> MarkT-: Buy hookers! <11> you could use that site to exchange gift certificates <10> teck: you can buy hookers on ebay? <12> Trade your Ebay gift certs for blowjobs! <10> No... <10> I think I'll p*** on that. <11> likes http://www.swapagift.com/ .. <11> s/likes/like <11> i've never used them though. <10> OT: ebay gift certificates are supposed to be nontransferrable. <11> oh. that's too bad. <10> I wonder why disgrunt didn't believe me when I said I'd won it... <4> why would you buy hookers? and not just rent? <10> I mean, it makes no sense... why would I lie about something like that? <10> rip: true enough... <11> because disgrunt is a toad and ***umes everyone lies to him because he lies to everyone else. <10> Apparently I have to wait 6 to 8 weeks before I'll receive the prize though... <10> they have to draw up some legal stuff for the winners to fill out <11> of course. <11> what sort of contest did you win? <11> (I only heard you got 2nd place) <10> hockey pool... on ebay.ca <11> oh. is that legal? <10> Yes. Trailed by 3 points. <10> If Edmonton hadn't bombed the way they did in game 2 of the cup, I would've been in 1st. <10> First place prize is $5k... second place is $1750, third $1k, 4th $750 and 5th place $500. <11> i was really hoping for edmonton to win. they did so well in game 6 i thought they would just keep going <10> OT: Yeah... I made quite the comeback in that game. <10> I probably would have been 4th or so if Edmonton hadn't had that shutout. <12> Professional sports is so boring. <12> So repetitive. <11> they just walked all over carolina. i was amazed. and #18 (i forget his name) broke his stick and just dove at the puck and took it in the rips. it was pretty impressive <12> I hate listening to the drones at work babble about "last night's game". <11> Teckla, it's more interesting when you know what's going on. <10> I also didn't do very well in round 2 of the elimination rounds... I went primarily with Ottawa and New Jersey in the east. <12> No...it's not. :) <11> Teckla, but really sports is like a soap opera for men. it's really about the drama of the game and being able to empathize with the players. <10> But I did very well in the quarter finals and conference finals, and all my players were on teams that made it to the cup. <11> MarkT-, so how much does it cost to join the pool? <10> I had 6 edmonton guys and 4 carolina guys. <10> OT: it didn't cost me anything. <10> There were about 80,000 people that entered. <11> oh. neat. <12> OrngeTide: Sports as a soap opera for men...damn. That's a good analogy. I'll have to remember it. <10> If I had gone with buffalo or Carolina in round 2 I would have been first place EASILY... <12> Soap operas are boring and repetitive year after year AFTER YEAR AFTER YEAR too. :) <11> it helps if you've actually played that sport before. <10> what's really amazing about this is that I know almost nothing about hockey... <11> like tennis. i love watching tennis. it's like a duel. and I've played tennis in high school and college. so it's interesting to me. <10> I don't generally follow the season <11> MarkT-, i follow the season until my team start ****ing :P <11> anyways. i gotta go pick up dinner (sushi) <12> OT...perpetually on the way out!
Return to
#c or Go to some related
logs:
#flash sheetrock coves #beginner #beginner #beginner #gamedev #delphi #bsd #beginner #beginner
|
|