Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

halp (pointers)

Name: Anonymous 2007-11-25 18:06

i have the following function:

char * find(const char * s1, const char * s2)
{ /* whatever */ }

Inside I move the s2 pointer with *s2++; How do I reset *s2 to point at the beginning of the string? I tried to make a counter and do it like this:

int counters2 = 0;
(later)
*s2++;
counters2++;
(later)
s2-=counters2++;

but it says "cannot modify a const object". What do I do?

Name: Anonymous 2007-11-25 18:10


char* original_s2 = s2;

Name: Anonymous 2007-11-25 18:37

You're a fucking moron.

Name: Anonymous 2007-11-25 18:55

Jesus Christ, pointers are so easy.

Try reading SICP.

Name: Anonymous 2007-11-26 19:25

You're missing a parenthesi. You wouldn't survive in Schemeworld, the
setting of the novel I'm writing.

Name: Anonymous 2007-11-26 20:28

>>5
milk throuugh my nose... was spat

Name: Anonymous 2007-11-27 3:22

>>6
milk throuugh my nose... was expelled
fix'd

Name: Anonymous 2007-11-27 3:23

>>7
milk through my nose... was expelled
fix'd

Name: Anonymous 2009-11-24 11:11

RISEfrom your grave!

Name: Anonymous 2009-11-24 11:16

FUCK YOUR NECROMANCY

Name: Anonymous 2009-11-24 11:26


(let ((list (list 'a 'b 'c)))
  (setf (car list) (last list)
        (cadr list) (cdr list)))

Name: Anonymous 2009-11-24 14:19

>>11

(setf *print-circle* t)
T
(let ((list (list 'a 'b 'c)))
    (setf (car list) (last list)
          (cadr list) (cdr list)))
#1=(#1# C)

WHAT NOW?

Name: Anonymous 2009-11-24 16:46

Name: Anonymous 2009-11-24 16:48

Every time I read car and cudder, I vomit a little in my mouth.

Name: Anonymous 2009-11-25 15:00

i am a virus. i ahev a long algorithm and i steal passwords out of your files w/ my code. if you dont repost this comment in 10 other threads i will break into your program tonight and dereference your null pointers

Name: Anonymous 2009-11-25 15:10

>>15
no please dont do this !

Name: Anonymous 2009-11-25 15:44

>>15
Whew. And here, I thought you were going to dereference my anus. Carry on.

Name: Anonymous 2009-11-26 21:31

>>quote

Name: Anonymous 2009-11-27 9:38

I'll reassign your dangling pointer, if you know what I mean

Name: Anonymous 2010-12-17 1:24

Are you GAY?
Are you a NIGGER?
Are you a GAY NIGGER?

If you answered "Yes" to all of the above questions, then GNAA (GAY NIGGER ASSOCIATION OF AMERICA) might be exactly what you've been looking for!

Name: Anonymous 2011-02-02 23:00

Name: Anonymous 2011-02-03 4:42

Don't change these.
Name: Email:
Entire Thread Thread List