Hi everyone, I'm a Perl programmer trying to get into C, and was curious if there were better ways to do the following few operations :

First off, removing a newline. With the string
$first in perl, i would simply type in chomp($first);

From what I understand, in C, I would have to type something in like:
first[strlen(first ) -1] = '\0';

Seems to be kind of a pain in the butt - Is there a better way to do this, or am I going to end up just having to write a function to do this since I'd be calling it fairly often?

Also, what do you do when you're dealing with a number being entered from some source where the variable could be either an int OR a float? Take the input in as a char and figure it out later, or? The whole int/float thing is really mind boggling, coming from perl

Also, is there a regular expressions library by any chance? What's the standard practice for pattern matching in C?

Thanks!