Ask your own question, for FREE!
Computer Science 17 Online
OpenStudy (anonymous):

Intro to computer programming HOW DO YOU DO CASTING CONVERSIONS? Simplest explanation possible please. Thank you

OpenStudy (anonymous):

in what language?

OpenStudy (anonymous):

@abtster like I'm an elementary school kid

OpenStudy (anonymous):

In what programming language?

OpenStudy (anonymous):

The answer depends on the programming language of choice

OpenStudy (anonymous):

Ok let me try it for Python, because there it is simple If a variable contains a string, e.g. s = '10' and you need to have an it as an integer number (a number without a decimal point), you can do n = int(s) if you need is as a floating point (= a number with a decimal point) you can do f = float(s) then f will be 10.0 If you need n or f as strings, that can be don with s = str(n) Then s will be '10', in n was 10 s = str(f) Then s will be '10.0', if f was 10.0 Python has many functions (str(), int(), and float() are functions) you can use to change the type of an variable

OpenStudy (anonymous):

@abtster oh, I'm using Visual Basics for this class. Does that make it a huge difference? And thank you by the way for helping me. It means a lot. Thanks

OpenStudy (anonymous):

VB.Net? The idea is about the same. CType(variable, type), converts a variable to the type is a kind of general option But there are a whole range of more specific options Here is a short introduction: http://www.fmsinc.com/free/NewTips/NET/NETtip6.asp Here is a more advanced introduction http://msdn.microsoft.com/en-us/library/x53d8wxa.aspx Here is an overview: http://msdn.microsoft.com/en-us/library/s2dy91zy.aspx There are many examples there Hopefully this is of some use to you

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!