strcmp
returns 0 if the two strings are exactly the same to accomplish what you want to do
Use :
strstr(s2 , "login:")
(It return NULL
if the string doesn't exist in s2
)
or
strncmp(s2 , "login:" , 6)
This will compare the first 6 characters (if s2
begins with "login:" , it will return 0)