@# 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



Comments:

<0> oh happy daaaaays
<1> oh happy days ...
<2> what's so nice about having my core dumped?
<1> Keep going Quantum``, keep going with the song ...
<0> when jesus walked?
<0> zxy, show me the updated code
<3> zxy: better than not having a core dump on undefined behavior, where's the code?
<2> just a sec.
<1> Quantum`` : Damn you! You put that "oh happy days" song in my head now ... crap! lol
<0> Kniht, having a core dump in my multi threaded code - care to debug it for me? :)
<0> PM2 :)
<3> I never said it was a good thing, just better than the alternative :P
<1> I love you, You love me, We're a happy family ...
<4> I have a craving for those pink circus peanuts
<3> eating a garbage bag is healthier
<1> Kniht : With or without content?



<3> either
<1> Hmm... tasty!
<4> Okay, it p***ed
<1> lol
<1> Kniht : The big problem with eating a filled garbage bag is that you sometimes end up eating someone else's teeth ...
<0> I went to the Ritz for high tea today
<2> damn.. not compiling now
<1> zxy : show us your code buddy
<0> and I pretended to be Lord Pembridge who just came back from the colonies
<1> Lord Pembridge? I prefer Lord Pampers
<1> Goes with the smell ... ;)
<0> Lord Sandwich
<2> http://www.noidea128.org/sourcefiles/16051.html
<1> That's if you've got cheese between your toes ...
<0> zxy, add a * infront the memtaby's
<2> i tried it..
<0> and to call it
<2> (*memtaby)->
<0> yes
<2> dumped core
<0> and to call it
<0> do
<0> inittable( &memtab ...)
<2> yea.. did that before.. dumped core :s
<0> well show me the code that is updated!
<2> maybe i didnt do both in the smae time. 1 sec
<0> hmmm...
<0> JBlitzen, how leftie is V for Vendetta gonna be?
<4> Well
<2> posted
<4> NBC had this to say
<4> http://www.msnbc.msn.com/id/11769182/site/newsweek
<2> http://www.noidea128.org/sourcefiles/16052.html
<2> found it lol
<2> stupid me
<0> JB, what really upsets me is that Portman did this movie
<0> stupid Harvard cow
<2> Quantum`` could i have kept the signature as (MemTable* memtaby) and then used **memtaby ?
<2> (just tryna understand the concept)
<0> ok
<0> here we go
<4> Life gets much easier when you stop expecting things from actors
<0> reagan was alright, never saw a movie he made tho ;)
<3> reaganomics
<0> zxy: type* p = 0 f(p) will keep p = 0 if f is defined as void f( type* p ) { p = 5 ; }
<0> but
<0> type* p = 0 f(&p) will change p to 5 if f is defined as void f(type** p) { *p = 5; }
<5> how would you take a number from a str array and do mathematical operations on it?
<3> void f( type*& p );
<0> zxy, comprende?
<0> Kniht, hes using C
<0> ahem
<5> say you've got str array[] {2, 3, 4}
<3> then start using c++
<0> I know its not the right channel, but too lazy to join C
<2> i understand that i wanted to send the address of p
<5> how to add array[2] and array[3]?
<3> skadet: str array[] = { 2, 3, 4 }; array[0] *= 42;
<0> Kniht, his code is totally 80ies C
<3> array[2] + array[3]
<3> but array doesn't have a subscript 3



<2> can i use f(type* p) { **p = 5; } ?
<0> no
<2> and p*** &p
<0> no
<0> cause it wont compile
<0> p***ing &p (if p is type*) is of type **
<5> Kniht: ok, so say you have an array array[n]. How to add array[1]...array[n]?
<0> lol
<1> skadet : hmm... loop?
<0> skadet dont use arrays, but if you do use array, you can do this with a forloop
<5> I would prefer not to use arrays but the input has to be on the command line
<2> what if i use f(void* p) { **p = 5; }
<0> then it will core dump
<1> skadet : What kind of input? A series of digits?
<0> most probably
<2> what does core dump mean?
<5> PM2: correct.
<0> you are modifying memory that isnt belonging to you
<1> skadet : What are the two arguments you've got when p***ing parameters from the command line?
<2> aha, okay
<5> int main(int argc, char *argv[]) {
<1> argc = number of arguments, including the first one which is the name of the app itself
<5> user inputs an arbitrary number of.. numbers
<5> PM2, right
<1> So just loop ...
<5> PM2, that's what I thought, but where does the intermediate result go?
<1> for(int i = 1; i < argc; i++)
<1> What d'you mean by intermediate?
<5> argc[i] + argc[i+1] == what?
<0> no
<1> Well just create a variable before entering the for loop
<0> you are all wrong...
<5> if we're looping, the result of i + i+1 has to go somewhere, so that we can add THAT to i+2
<0> argv is char*, you will need to convert them to int first
<5> PM2, tried:
<5> for(i=1; i<argc; i++){
<5> hold = ((int)argv[i] + hold);
<5> }
<0> wrong!
<1> var += argv[i] ...
<5> Quantum: and so we arrive to my original question.... str to int
<1> atoi()
<0> check out STL's std::stringstream
<5> Quantum: I'm in C, but #c is +k
<0> jebus
<0> this is such a C night
<5> heh
<1> lol
<1> Dog Dammit Quantum`` ... ! ;)
<5> The prog should be simple enought, right?
<5> Syntax:
<1> Hold on skadet
<5> myprog [input1 input2 ... inputn]
<5> returns: input1 + input2 + ... + inputn
<5> I'm just brainfarting
<0> dont use C
<1> http://www.noidea128.org/sourcefiles/16053.html
<1> That works
<5> looking
<5> ok, now I translate from C++ to C ;)
<1> You could actually make it run faster by replacing int temp = 0 by int temp = atoi(argv[1]); and start the for loop with int i = 2;
<0> not if there are 0 arguments...
<0> then it would core dump
<5> Quantum: if (argc < 2) { printf("0\n"); return 0; }
<1> It won't go into the loop then Quantum``, because you have i < argc
<0> but int temp = atoi(argv[1]); would coredump
<1> Yes, it would
<0> say my name biotch
<1> Jesus
<0> such a jewish name
<1> Oh sorry... typo ... I meant Jebus!
<1> http://www.noidea128.org/sourcefiles/16049.html
<1> I know you're good Quantum``, so I'm sure you can help me out with this issue I've got ...
<2> :-D my shell is so nice :-D


Name:

Comments:

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






Return to #c++
or
Go to some related logs:

#linux
#linuxhelp
#linux
#chatzone
#chatzone
#MissKitten
#chatzone
#mirc
#skype
gmerc -diablo



Home  |  disclaimer  |  contact  |  submit quotes