| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10
Comments:
<0> another of the many ways they serve the cl*** of wealth and greed <1> MishMan and what if i can't do better? becouse i can asure that it will use less "jumps" using the goto statement... and the code should be smaller too, is it still bad to use it? <2> [E]dvinas: all c can be written without goto, if you can't do better than goto, you're a bad programmer <3> [E]dvinas: I,personally, n3ever di backward goto, but I do forward goto albeit sparingly <3> s/di/do/ <1> i need to do forward... <3> you always can add flags to avoid goto, the question is ... <1> i need to do a variable jump after the given parameter... <4> Ok, so what would you propose for GUI programming in linux ***uming that I more or less know C, and have engine programmed in C ? <3> care to post code ? <4> Tcl/Tk ? <3> i'll tell you if goto can be avoided or not <5> Tcl rocks ! <1> MishMan i'm only planing to write it...
<3> but then the discussion doesn't make sense <3> i rewrite code 20 times <3> some versions are with goto, some without <3> until i reach perfection <6> What's the best way to p*** "bool foobar[ m ][ n ]" to a function, where m and n are variable? I thought I would just "bool *foo", but inside the function, I cannot access foo[ 1 ][ 3 ] or the likes. I tried "bool **foo", but I don't believe that is what I want either. Any suggestions? <7> MishMan, i like using goto instead of flags. <1> but what's the bad side of goto/label? in executing/compiling such code, besides that i may be a bad programmer becouse i do so? <8> float: They're really variable? As in you're using C99's VLAs? <3> OT yes, this is often smaller code <7> you're a bad programmer if you refuse to use goto. <6> Xirtam: funny :P <1> so goto it is :P <1> :) <9> [E]dvinas: Wrong use makes it unreadable and unmaintainable. Just as with every other construct, but it's particulary easy with goto. <1> i mean will be... <8> Float: It's not supposed to be funny. It was supposed to elicit a real answer. <7> if you use goto sparingly for the purpose of the behavior of the code clearer then you've done a good thing. <10> I need to p*** a pointer to a linked list node into one function, which will in turn call a 2nd function, p*** it into that and have it modify the value of list *node->next. so in main if I have list *node; and I call function1(&node); and then function1 calls function2() how do I p*** the address of node into function2 so function2() can modify the value of node->next ? <1> not that my method will make the code clearlier but also will make it smaller and i think that the real compiled and ***embled code will be smaller <3> Float_: depends on how you allocate the 2d array <3> [E]dvinas yuo can never say like this until you actually write and rewrite the code <7> the "goto considered harmful" article is something that people never apparently read. it basically says don't use goto for doing loops when constructs like while and for exist. <3> i don;t believe you write finally perfect code from the 1st time w/o rewriting and polishing <6> Xirtam: Sorry, no I am not using C99's VLAs <1> i do rewrite my code... <3> so how you allocate this array <8> Float: Then you'll have to explain how you declared your array. <1> today i've done it 6 times already <1> ok, i've got my answer... thanks :) <3> i wish language had goto-with-parameters <3> ilke goto(x,y,"abc"); <7> MishMan, tail-recursion optimization can do that.. :) <3> and label had formal arguments like: mylabel(x,y,str) <3> just as syntax sugar <3> there are often soe ***ginments before goto <11> MishMan: those are called "functions" <11> hehe <3> no no <3> functions, you call then <11> I know. <3> labels, you goto them <11> <-- was being a smart*** <11> see? ***, smart. <12> MishMan: how is that different from functions? <3> this is smart ***: http://www.stanwelltrailers.co.uk/images/smart2.jpg <3> mauke: because they are not callable, just labels inside functions <12> they're "callable" by goto <3> they are goto-able <7> does myrddin ever read his privmsgs? <11> whoops. <7> ehhe <11> hehe <12> MishMan: great, so you have a new kind of functions that is incompatible with normal functions <7> it took me a while to get used to irssi's privmsgs <3> the syntax is goto label(args); <11> lemme employ my privmsg log reader (ie. grep) <3> you don't understand <12> no, you don't understand <7> i wish C have native coroutines.
<3> int foo() { int err=0; ...; goto fail("message"); ... fail(str): return -1; } <3> i just sometimes do it with macros <3> so that ***ignment + goto takes 1 line <12> replace goto fail("message") by return fail("message") <12> surprise, it's a function <3> the problem if you have common cleanup before all those returns .... then you prefer the goto <11> aw, crap. I forgot I restarted this session. no log for the last day and a half. :( <7> MishMan, i think it should be goto label(expression); where an expression can contain a lambda <12> MishMan: that's also incompatible <10> I want to modify a linked list node p***ed two functions deep, but I'm p***ing it wrong and not sure where, any ideas? - http://www.rafb.net/paste/results/g0mYhf72.html <7> oh! and you should be allowed to change the namespace as part of a goto. <11> I should have my privmsgs go to a different logfile anyway <7> myrddin, aww. <12> MishMan: labels with arguments shouldn't be reachable by normal control flow <12> that's pretty much the opposite problem of goto foo; { int i = 42; foo: i; } <12> only here it's { foo(i); i; } <12> s/;/:/ <3> mauke: why ? <12> because i doesn't exist there <12> it's created by a goto foo(42); <3> with label parameters, i'd not declare the type but only mention the var name, the var itself is declared elsewhere like: <3> int foo() { char *msg=""; goto fail("error");... fail(msg): print(msg); return -1; } <12> that's even more evil <3> maybe <3> C is evil <12> implicit ***ignment ... <3> function call is implicit asgnment, too, for every arg <12> yeah, it should be implicit binding, though <12> (call by value is evil) <12> MishMan: it's initialization, not ***ignment <3> maybe int foo() { char *msg=""; int rc; goto fail(msg="error",rc=-1); ... fail: print(msg); return rc; } <3> this is pretty easy to do with macro <3> #define GOTO_AND_***IGN(label,expr) do { expr; goto label; }while(0) <3> np <3> #define ***IGN_AND_GOTO(label,expr) do { expr; goto label; }while(0) <12> who submitted OrngeTide to qdb.us? <3> which one <3> normally, it's me <12> <7> if you use goto sparingly for the purpose of the behavior of the <12> +code clearer then you've done a good thing. <3> me <12> why? <3> i like it <3> what's your problem <12> it doesn't even make sense (there's a missing "making") <12> and it's not funny <7> yea. my english ****s many. <3> it's words of wisdom <7> soldier boy! me love you long time. <3> OT: i bought the parts for that rs232-controlled relay <7> MishMan, cool <3> i will be soldering some day <3> i'm not sure the relay i got is right but i'll see <7> mauke, there are tons of qdb.us quotes of me. i think all submitted by Mish <3> wat's max323s <3> mauke: i don't edit them before posting. that's why it's called "quote" <7> MishMan, it's TTL to RS232 signal convertor. <10> what does this mean from gcc: warning: void format, pointer arg (arg 2) The code for the line is: printf("stuff %p\n", ptr); ptr is of type char ** <12> it means *ptr should have the type void, not char * <10> why should it be void, when I am p***ing it the address of a char * <3> strange i dont get such warning <12> because %p expects a void * <3> even with -Wall <3> something is fishy here <10> well perhaps more of the code is relevant than I posted <12> no, just fix the type <12> (void *)ptr <10> just cast it in the printf statements <3> 'void format' ? %p is not 'void format' <12> it is, if you dereference one level <3> ncaller_: let's see if mauke's cast helps <10> they do in fact get rid of the warning <3> mauke: where do you see the latest quotes in qd.us ? <12> qdb.us/queue
Return to
#c or Go to some related
logs:
#beginner #cisco windows xp memory limit #windows #beginner ddrvtt overclock nerif.pk dkestop #goal #computers
|
|