Created
September 3, 2019 02:41
-
-
Save parzibyte/fd6052c5ae3804959427f5245b09b918 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <stdio.h> // Para sscanf | |
// https://parzibyte.me/blog/2019/06/19/namespaces-cpp-using-namespace/ | |
using namespace std; | |
int main() { | |
int numero = 0; | |
const char *numeroComoCadena = "2811"; | |
// Lo convertimos usando sscanf, que | |
// escanea datos a partir de una cadena | |
sscanf(numeroComoCadena, "%d", &numero); | |
std::cout << "El número es " << numero << " y el doble del mismo es " | |
<< numero * 2; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment