• Courses
  • Code Compiler
  • Discuss
  • Pricing
  • Teams
Menu
+ 1

string to int

How can I turn an string variable into int?

c++intstringvariable
8th Dec 2019, 1:49 PM
Zohal
Zohal - avatar
1 Answer
+ 5
Assuming you're using a std::string : std::string str("123"); auto i = std::stoi(str);
8th Dec 2019, 2:15 PM
Théophile
Théophile - avatar

Often have questions like this?

Learn more efficiently, for free:

  • Introduction to Python

    7.1M learners

  • Introduction to Java

    4.7M learners

  • Introduction to C

    1.5M learners

  • Introduction to HTML

    7.5M learners

See all courses
Hot today
Functions in python
2 Votes
How to make a playground
1 Votes
Html 5 document question
1 Votes
đ™”đ™žđ™œđ™ł đšƒđ™·đ™Ž đ™žđ™œđ™żđš„đšƒ đ™Ÿđ™” đšƒđ™·đ™Ž đ™żđšđ™Ÿđ™¶đšđ™°đ™Œ
1 Votes
Python
0 Votes
Can someone explain inline and block elements please
0 Votes
Actual Artificial Intelligence
0 Votes
Need friends
0 Votes
MASS N NUMBER OF OBJECT DELETION FROM A CLASS
0 Votes
Schuffle a list
0 Votes