How make a kind of scanf()?

If I understand, with your code, I just need to declare a int variable,then this variable will be equals to atoi(buff)?

And normally, if the user write "123456", this variable will be equals to "123456"?

Because I tried it, I wanted to display this variable but there's nothing printed except "0"