0

Hey guys just a quick question on the atoi function.

In the Caesar walkthrough video with Zamyla, at around 06:00 she mentions investigating the "atoi" function in order to see what would be returned if the input to the function "doesn't contain all numbers".

looking into the man of "atoi" page it stated pretty much what i expected it to say (basically this function converts characters to integers and there are other relatives of this function etc).

I feel like there is something I've missed here that may become important down the line if not identified early.

Is it just to write my code to ensure a correct user input of all numbers into the programs decipher key? or is it something more?

I'd appreciate any input, answers or further clear explanation of the "atoi" function so i can decipher Zamylas cryptic message..... see what i did there :)

PotNoodle

0

Simply put, atoi() will take a string and convert it to an integer. Note that it converts a string, not a character. You also need to know what it does if the string isn't all numeric characters.

It serves two purposes. One is to validate that the input is an integer. The other is to convert the string form of that integer to an actual int type so that it can be stored in a var.

If this answers your question, please click on the check mark to accept. Let's keep up on forum maintenance. ;-)

| improve this answer | |
  • thanks Cliff :) – Pot Noodle Dec 30 '17 at 22:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .