Horje
c++98 check if character is integer Code Example
c++98 check if character is integer
std::string s = "1234798797";
std::istringstream iss(s);

int num = 0;

if (!(iss >> num).fail()) {
    std::cout << num << std::endl;
}
else {
    std::cerr << "There was a problem converting the string to an integer!" << std::endl;
}




Cpp

Related
c++ client service ros Code Example c++ client service ros Code Example
declaring array of int Code Example declaring array of int Code Example
for loop f# Code Example for loop f# Code Example
map in cpp Code Example map in cpp Code Example
how to find data size in c++ Code Example how to find data size in c++ Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7