C++: How to tell if a string is actually an int
Channel:
Subscribers:
2,650
Published on ● Video Link: https://www.youtube.com/watch?v=JFmU0KSBKFE
Suppose you have these strings:
"100"
"Hello"
"9Gag"
"Love4All"
Which of them can be converted to an int by stoi? The rule is: the first character in the string must be an int. So if (isdigit(s.at(0))) will be true if it can be converted.
Other Videos By Bill Kerney
2023-12-01 | Keith: The C++ Mascot |
2023-11-30 | Make a Metahuman Your Avatar |
2023-11-30 | UE5 Level Sequencer: Foosball Time |
2023-11-29 | Java for C++ Programmers |
2023-11-28 | Discussion of MoCap and Metahuman Creator |
2023-11-27 | The power of modification in computer science |
2023-11-22 | C++ Trivia & Trolling Quiz |
2023-11-21 | Quadtree Lecture 1/3: Writing helper classes for a Quadtree |
2023-11-21 | Quadtree Lecture 2/3: Writing a Quadtree & Insertion |
2023-11-20 | C++ Exceptions |
2023-11-20 | C++: How to tell if a string is actually an int |
2023-11-17 | C++: How to Find a Bug |
2023-11-16 | UE5: Elevators and Blueprint Interface to Use an Object |
2023-11-15 | Contiguous Memory in C++ (2D to 1D mapping) |
2023-11-14 | Sound Cues for Background Music |
2023-11-14 | Setting up Raylib with VS Code |
2023-11-13 | C-style C++ (it's a thing still) |
2023-11-09 | Dynamic Materials: Gone, Reduced to Ashes |
2023-11-09 | Acceleration Structures: Quadtrees/Octrees/KDtrees/BSPs |
2023-11-08 | Lab Time Week 14: Parsing Pokemon |
2023-11-07 | Ludology: Cartographers Game Analysis |