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

takes a string as a parameter and returns an integer

OpenStudy (anonymous):

What language is this problem for? Most languages I've dealt with have a casting function that could be used to return an integer from a function with a string passed as an argument.

OpenStudy (unklerhaukus):

atoi()

OpenStudy (anonymous):

Most languages also have len(), length(), str_len() or some other variation thereof that return the integer length of a literal string.

OpenStudy (anonymous):

You could use ToInt(string), it depends really what language you're coding it in.

OpenStudy (anonymous):

Sorry, I mean StrToInt(string variable)

OpenStudy (e.mccormick):

As seandisanti points out, there are lots of these. You could pass a string and get the count of the length, the number of spaces, the value as an integer representation of the ascii code position, the translation from numeric letters to an integer, and more. It all depends on the language and what function you send it to.

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!