How do you convert datatypes?

Arduino has has the following functions:

char(), byte(), int(), word(), long(), float()

If I try using them on the Spark, however, I get errors similar to this:

invalid cast from type 'String' to type 'int'

Is there a trick I’m missing?

Try string.toInt() if what you’re looking to do is turn a String object into an integer.