aside from itoa function, is there any other way to convert a string to an integer? itoa function won't work in my compiler.

Recommended Answers

All 2 Replies

itoa is not an ANSI/ISO standard function and is non-portable, also it converts an integer to a string not a string to an integer.

Try atoi or strtol

thank you, I'll try that

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.