To be specific, what the code does is as follows:
|
hostpart = index(buf, '@')
|
buf is, presumably, an array of characters, and hostpart is, presumably, a pointer to a char. This function call sets the value of hostpart such that it points to the location in memory of the first occurrence of the character '@' in buf.
This does the following:
1) Changes the value at that location to be '\0'.
2) Increments hostpart, so that it now points to the character after the new '\0' in buf.
This effectively terminates the string held in buf where the '@' character used to be.
It also leaves hostpart pointing to the part of buf that was immediately after the '@'.
In other words, you now have 2 strings - one containing the part before where the '@' used to be, and one containing the part afterwards.
Personally, I dislike the needless packing of multiple operations onto one line like this. I'd have written it:
1 2 3
|
hostpart = index(buf, '@');
*hostpart = '\0';
hostpart++;
|
(Edited, cause I screwed up the first time.)