That's actually quite a bit of work.
You need to read the user input as a string, and then process it into tokens - and how complex that process gets depends on how "full" your calculator is.
By that, I mean do you want to just process this:
3+2.5
Giving 5.5, Or do you want to process this:
3+2.5*-4
Giving -7.0?
The first example is fairly easy: process digits and a single full stop until you meet something that isn't and that's your first number. The thing that isn't is your operator, and then you look for the whole second number.
You can then convert the numbers to floating point values using the
strtof function[
^] and process the operator via a
switch
The second version is a lot more work: you will need a stack (and probably to convert your whole expression to ReversePolish notation to make it easier to process). Google can help you there is you look for
Calculator C - Google Search[
^] and start reading!