JUCE does not see atoi

Why does JUCE refuse to see atoi?

I included
and used

String aNumber = “23”;
int num;

num = atoi(aNumber);

I tried both with
using namespace std;
and without but using
std::atoi(aNumber);

Every time I get an error:

no matching function for call to ‘atoi’

in the Build area of Projucer.

I have used similar code in eclipse which works. Any help would be greatly appreciated.

String doesn’t have an implicit conversion to const char* so can’t be used like that.

And atoi is very very old-fashioned nowadays - it’s a C function, not even C++.All you need to do is:

num = aNumber.getIntValue();

Thanks Jules
The question arose from some exercises that I am doing while going through the book “The Audio Programming Book” which is mostly based on C with some C++. So, your observation about C function, etc are quite right.