@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3 4 5 6 7 8 9



Comments:

<0> hi jaggy
<1> another sleepless night
<0> well it's hard to sleep when you're sitting at your computer.
<2> heya Jagg :)
<3> h e l l o
<0> Gambit-, how's your project?
<3> hey OT Jag Gamb
<0> mishiemish
<3> brb
<4> hey mish :)
<0> okay. everyone has said hello
<4> I'm reading apache fastcgi docs to see how to change my cgi to fastcgi
<0> i don't like fastcgi. processes sitting around annoy me. :P
<2> OrngeTide, Well between the last time I taked to you and the now I've only slept :P
<0> Gambit-, lazy. why are you sleeping at night.
<2> I dunno, it's a bad habit I've been getting into :) I think I'm training my body to work daylight hours, for some reason...



<0> ehhe.. when you come to the states you'll be working all night and sleeping during the day, like a normal person
<0> well i'm going to bed. it's 2am. g'nite.
<2> night :)
<5> 10 am here, good morning :)
<5> oops, sry, 11am already ... time flying by like deadlines, woosh woosh ...
<2> well it's noon here, so there you go :)
<6> Gambit-: Are you still in Egypt?
<2> Yup
<6> Importing cherries?
<4> I should buy another noise-reduction earmuff thingy
<4> not the electronic things either..
<4> unless you know of one which can get higher than 30db like the ones I have
<7> hio
<8> mornings
<9> Is it possible to download & save videos on YouTube?
<10> everything is possible
<9> Okay then: Does anyone know how to do it?
<2> hrrrm....
<11> what is utube
<11> youtube
<2> Teckla, troll digg, there's a "download videos from ____" article about once a week.
<9> jeffloc: www.youtube.com
<9> Gambit-: Ah, thanks.
<12> Teckla, easiest way I've got - sniff the traffic till it requests the FLV file, then get it.
<9> Found a solution on digg.com as recommended by Gambit-. All hail Gambit-!
<9> <seinfeld> The 1960s called...they want their debugger back! </seinfeld>
<9> Cygwin has a decent debugger called insight.
<9> I think it uses gdb under the covers.
<9> There's also ddd.
<10> Teckla i dont watch that site, but i guess any streamer ripprs can
<10> ive seen it been done too
<13> is it possible to print directly from a file onto the screen without allocating temporary storage to hold the data, is this okay to do: FILE *fp=fopen("file.txt", "r"); fprintf(stdout, "%s", fp);
<13> actually this would be opened in "rb", it is binary file but it only has char data in it
<14> ncaller: maybe use a fifo ?
<8> Alipha smellses!
<15> yeah. i haven't showered yet today
<8> Do what?
<8> Show-er?
<8> what's that?
<15> apparently you haven't either--ever
<16> What is wrong with this code: struct T { char one[20], char two[30] }; void f(struct T *pt) { char **pc[] = { &pt->one, &pt->two }; ... }
<16> pt->one decays into char *, and &(char *) is char **?
<16> Compiler gives me a warning: 'char ** ' differs in levels of indirection from 'char (*__w64 )[20]'
<16> I know char[] is not char *. How do I avoid this warning?
<17> pkrumins: just remove the ampersands.
<16> hmm
<17> a member in char ** is already defined char * and C converts char arrays to char pointers without extra syntax
<16> Doesn't work: 'initializing' : 'char ** ' differs in levels of indirection from 'char *'
<16> Now it differs by one level of indirection
<16> Which is right, since pt is a * to struct T and pt->one is a char[] which decays into char *
<18> &pt->one has a differnt type than pt->one.
<16> yes of course
<17> this is actually weird since elements inside a char** are char*
<18> but you want an array of pointer to pointer to char, yet you try to provide two pointer to array of char.
<16> what's a "two pointer"
<16> Right, I want an array of pointer to pointer to char. With &pt->one I provide a &(char []) which I thought would decay to &(char *) which would become char **
<18> two of: pointer to array of char, each array a different size. doesn't matter, they aren't pointer to pointer to char, which is what your array is supposed to contain.
<16> Right



<18> now, if pc were declared: char *pc[] then you could initialize it with { pt->one, pt->two }.
<17> why wont you try char *a[2]; a[0] = pt->one; a[1] = pt->two; a[2] = NULL;
<17> even i failed to see that little syntax error :)
<16> acid, a[2]? there is no such element?
<18> of course the initializers aren't static, so initialization itself is something of an issue.
<17> oops
<18> s/static/constants/
<17> there is actually
<17> i mean
<17> you should initialize it to NULL
<16> you are right, but it is C99, isnt it, twkm
<18> nope. you cannot ***ign to an array, not even in c99.
<16> ouch.
<18> you could use memcpy in c99, but really you aren't saving enough to worry about: char *pc[2]; memcpy(pc,(char*[]){pt->one,pt->two},sizeof q);
<18> err, sizeof pc
<16> yes, really.
<16> But why is char *pc[] = { pt->one, pt->two } allowed? pt->one is char[20], other is char[30]. How does it happen that array contains char pointers?
<16> Do both char[20] and char[30] decay into char *?
<17> a char pointer to an array is actually a pointer to &array[0]
<17> the compiler automatically does the conversion
<16> hmm.
<16> ok
<16> but then, why can I initialize an array with non constants in this case?
<18> you cannot, in standard c.
<17> go c++ :)
<18> hint: gcc without options is not a c compiler.
<18> ... it is a gnu-c compiler.
<16> yes
<16> when doing a memcpy of structs, do I p*** (1) sizeof(struct STRUCTURE) or better (2) sizeof(variable_of_type_struct_STRUCTURE)?
<16> or they are exactly the same
<17> doesnt matter
<0> twkm, you can initialize variables (structs and arrays) with non-constants in "standard" C. just not obsolete C.
<17> but dont use sizeof to a pointer because that size will always be 4 bytes or 8 depends on the architecture.
<16> acid-, yea
<17> i always use the name of the structure
<16> i am always using sizeof(struct STRUCTURE)
<0> sizeof *ptr is handy though
<16> aha
<17> nice one.
<0> i never use the type name if i can avoid it.
<0> i like to rename things a lot and it just introduces bugs in my code when i screw up renaming things
<0> too bad malloc isn't type safe, otherwise this wouldn't be an issue.
<0> i mean i could use c++, if it wasn't just so horrible.
<16> Is it a good style? if i was to read your code It would take me two lookups to find definition of type of thing you are taking size of?
<0> most people are willing to take the bad with the good.
<18> OrngeTide: but they must be computable, and p->array isn't.
<0> pkrumins, you generally don't care what type something is do you? and looking at the malloc is not really a reliable way to determine the type of a variable.
<0> twkm, not in a global, but in a local it is.
<8> OrngeTide: You still ***y?
<18> OrngeTide: so you are telling me that your standard c compiler accepts: struct { char s[10]; } *p = malloc(sizeof *p); char *q[] = { p->s };
<18> i strongly doubt it.
<16> 6.7.8.4: "All the expressions in an initializer for an object that has static storage duration shall be constant expressions or string literals."
<18> yours isn't static.
<16> ah, that's static storage
<16> yes.
<0> twkm, C99 does support it, but in a round about way.
<18> OrngeTide: in an initialization? i think i missed it.
<0> http://rafb.net/paste/results/HRvn4M54.html
<0> you can do more exotic things than that in C99.
<0> actually the way you did it works as-is in C99 too.
<0> (i just tried it and gcc -std=c99 -pedantic didn't complain). but i don't know with absolutely certainty that it's legal.b ut the example I did is certainly legal
<0> C99 lets you do crazy stuff though. like compound literals where many of the arguments are non-constant. which isn't really a literal anymore, it's just fancy ***ignment
<0> struct vec { int x,y; } struct vec foo(int x, int y) { struct vec ret; ret=(struct vec){x,y}; return ret; }
<0> there are some weird allocation going on when you do those though. like if you do a loop it only allocates it once and just keeps reusing it.
<16> I cant find anything about in c std iso 1999 standard about initializer being a constant.
<16> for a variable with automatic storage
<0> for(i=0;i<n;i++) { myfunc((struct vec*){i, -i}); } .. that's a little funny, myfunc better not hang onto the pointer you gave it because it will get reused, iirc.
<18> OrngeTide: those are ***ignments, not initializations.
<0> twkm, yea. i said ***ignment.
<16> ah
<18> OrngeTide: yes, we knew that ***ignment was possible.
<0> i'm just off on another tangent. i ***umed the whole initialization argument is over now
<0> because you can indeed initialize automatics with non-constants.


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #c
or
Go to some related logs:

#mirc
adultfreevideos
#debian
www.tampaforums.com
gentoo gettext function not found
RU0LD
#beginner
#gamedev
ntpd dummies
symatic argument



Home  |  disclaimer  |  contact  |  submit quotes