I am currently coding a application. I reading a user input using fgets() and then comparing it to a string which i retrieve from a mysql database. my problem is that when i read the user input i initially have to create a char[] array with a definite size. after the two strings are determined i try to compare them but they wont equal because the char[] will have empty characters after it. How would i get around this?