SyntaxFix
Write A Post
Hire A Developer
Questions
Yes, you can store the integer directly:
int num = 45;
If you must parse a string, atoi or strol is going to win the "shortest amount of code" contest.
atoi
strol