That code has nothing to do with emails: it is to do with (very primative) CSV handling - even the comments agree.
If you mean that you need to split an email address "xxx@yyy.zzz" into two parts: "xxx" and "yyy.zzz" then that's relatively simple, provided you look at the rules for email addresses. This gives them nice and clearly:
Email address - Wikipedia[
^] In practice, you can probably ignore that the local part of an address may contain '@' - I've never seen one, nor have I seen a system set up to accept one. If you do decide to permit them, it's still not complex: start from the right hand end of the string, and search back for the last '@'. Since a Domain name cannot contain the '@' characters, that will always mark the separation point.
So: it's not complex: Copy the string into a new array, and locate the '@' character which separates the local and domain parts. Replace it with a null character '\0'.
The pointer address after the null is the start of the domain, the start of the array you copied into is the local address.
Done.
But this is your homework, so writing the code is up to you!