how to convert string into number

C++
let myNumber = Number("5.25"); //5.25let theInt = parseInt("5.90123"); //5
let theFloat = parseFloat("5.90123"); //5.90123// A program to demonstrate the use of stringstream 
#include <iostream> 
#include <sstream> 
using namespace std; 
  
int main() 
{ 
    string s = "12345"; 
  
    // object from the class stringstream 
    stringstream geek(s); 
  
    // The object has the value 12345 and stream 
    // it to the integer x 
    int x = 0; 
    geek >> x; 
  
    // Now the variable x holds the value 12345 
    cout << "Value of x : " << x; 
  
    return 0; 
}
var text = '42px';
var integer = parseInt(text, 10);
// returns 42
new Number(valeur);
var a = new Number('123'); // a === 123 donnera false
var b = Number('123'); // b === 123 donnera true
a instanceof Number; // donnera true
b instanceof Number; // donnera false
Source

Also in C++: