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

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-26 19:25

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

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