| |
| |
| |
|
Page: 1 2 3
Comments:
<0> if p is declared as char * p, then you should use p = &x; <1> Question: How much will the waterlevel fall if one removes the water from all the worlds oceans? <2> 10924 meters <3> uhm <3> depends how deep the seabed is, basically <2> in that case 10924 meters <1> How did you arrive at that number? <2> it is the deepest spot in all the worlds oceans <2> Mariana Trench <1> you serious? now or what? <1> I thought you were being facetious <2> yes <2> Mariana Trench is 10924 meters deep <1> How about this: If you pour 50kg of icecubes into a bathtub, how much will the waterlevel have have been raised after they've melted? <2> http://maps.google.com/maps?f=q&hl=en&q=11+21+0.+142+12+0.&ll=11.781325,142.207031&spn=37.540739,85.429688&t=k <2> afters they've melted compared to what?
<1> I rather do believe that the waterlevel raises when you pour the icecubes into the water and not when they've melted as they displace the same amount of water as their m*** which, when melted, equals that. <2> yes ;D so how much did the waterlevel raise from which point? <2> so which numbers do we compare ? <1> It doesn't say that it specifically has to be from before the icecubes are poured into the water. <2> but could it be? <1> It's a mindgame, of sorts. <2> true ;) <1> :) <2> the waterlevel may have dropped before all the ice is melted <1> how so? <2> if it's warm and dry air the water will become fumes <2> what kind of expression you say that ? <2> that also depends on the size of the bathtub ;P <1> :) <1> Hahaha - CNN, a mans brother-in-law bit his finger off and was holding it hostage ... Only in New York <2> =D <2> that can only be happening in america ;) <1> yea lol <2> I couldn't imagine that happening on my neighborhood ever :D there are never even hostage situation <4> http://www.feyrer.de/NetBSD/blog.html/nb_20060805_2350.html <5> hubertEF- a pointer to an array? <4> what are those ()s for? <5> so that it's not an array of pointers? <4> what now - array or not? :) <4> <5> so char x[] = 7001, (*p)[] = &x; would work? <5> hmm <4> what are you trying to do? <5> p*** a number to getaddrinfo() <5> iniofs? <4> getaddrinfo(42)? <5> getaddrinfo(NULL, port, &hints, &res); <5> port <5> specifically <5> the others seem to work fine <4> 2nd argument is servname here...? <5> yep <4> const char * restrict servname <4> wtf is 'restrict'? <5> it's a C99 thing <5> the apple man page has const char *servname <5> restrict means something can only be accessed as a pointer <6> iT's char * <7> can someone tell me how i get wpa_supplicant it said its included in netbsd 4.0 <7> but i dont seem to have it is it a kernel option i must enabled <4> mspo: <4> The hostname and servname arguments are either pointers to NUL-terminated <4> strings or the null pointer <4> The servname is either a deci- <4> mal port number or a service name listed in services(5). <1> ask on freenode <1> they probably know <4> mspo: if you want to specify a number, you have to convert it to a string first, see sprintf(3) <4> char portstr[999]; <4> sprintf(portstr, "%d", 6667); <4> i'm sure there are ways better functions than sprintf() security wise, but I don't know them. maybe something like snprintf() or asprintf() <6> snprintf <4> Be sure to use the proper secure idiom: <4> snprintf(buffer, sizeof(buffer), "%s", string);
<6> although he could stuff it in a char <4> he could just use a hardcoded service name (string) :) <4> but what do I know <6> yes as in the example <4> hmmm <5> I mean <5> can't I just say "char foo[] = 7001; "? <4> no <4> because the thing on the right side of the = is no string <5> what if I put it in " " or ' '? <4> and for an array initialisation, you need to p*** exactly that <6> 7001 is an integer <4> char foo[] = "7001"; <4> that'd work <6> and not a null terminated char array <2> foo is not a valid example <4> note that this leaves out the size of the 'foo' array, and lets the C compiler determine the size <5> but for getaddrinfo, I need to say *foo[] = "7001"; <5> char *foo[] = "7001"; <4> d00d <2> http://exposed.coldfront.net/?226 <4> there's big honking difference between a char foo[], a char *foo, and a char *foo[] <5> d00d, I need to review pointers? :) <4> d00d, indeed :) <6> or check out the grocery store:) <4> heh <6> http://home.netcom.com/~tjensen/ptr/ch1x.htm <5> char *port = "7001"; compiled <5> hmm <5> ah, because it's the same as port[] = "7001" <5> because char's are pointers <4> no. <6> a char can be a for example. A string is an array of chars <4> or a pointer to an array of chars ;) <6> a pointer points to a memory location <6> and may point to a char array <5> I thought a char was an array of int's. And &char pointed to int[0] <4> what is a char? <6> char = "character" which can also be represented as an integer <5> char is an array of int's ending with \0 (null) <4> mspo: no. <6> No, mspo, you are conpusing types <6> confusing <4> <6> conphusing <6> a char cannot hold "mspo" for example as it is one byte <4> char == byte (character) <4> with a byte usually having 8 bits (and let's not not go into signed vs. unsigned now) <4> int == an integer with usually 32bit <4> and I don't recommend trying to mess with the internals of an 'int' as being composed of several 'char's <4> (think "byte order") <5> so let's say I wanted to store a string like "7001 is the port" <4> grab some space to hold the text, then copy in the single bytes <5> char str[18] = "7001 is the port"; is incorrect? <4> yes <4> but 17 would be enough ;) <4> if you want to save the counting, you can use []s in that case, and the compiler will figure it out <6> for "mspo" you need five bytes <5> yes it's incorrect, or yes it's correct? <4> yes, correct syntax <5> okay <4> 'str' identifies the start of the space of 17 (18?) chars <5> 17 + \0 ? <4> it has the address of the first character <5> right <5> so if I said <4> miyu% echo -n '7001 is the port' | wc -c <4> 16 <5> char *str = "7001 is the port"; <4> 16 + '\0' = 17 :) <5> okay, I might me miscounting :) <5> so you were saying char *foo is different from char foo[] ? <5> #include <stdio.h> <8> I never did grok pointers <5> int main() {
Return to
#netbsd or Go to some related
logs:
#politics #eggtcl #politics #politics *the biggest oil company world's* nusb22e.exe tv cable pci card #delphi #politics #computers
|
|