Then probably the 0th element of email_address.arr contains '\0' or a space or something like that. Use a printf statement in a for loop to print sufficient amount of data stored in email_address.arr and check