Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created January 6, 2021 21:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/aa90e9eafb662c724e1c98ad94bbd343 to your computer and use it in GitHub Desktop.
Save parzibyte/aa90e9eafb662c724e1c98ad94bbd343 to your computer and use it in GitHub Desktop.
// https://parzibyte.me/blog
#include <iostream>
#include <array>
using namespace std;
int main()
{
array<string, 5> nombres = {
"Luis",
"Atlas",
"Link",
"Leon",
"Fontaine",
};
for (size_t i = 0; i < nombres.size(); i++)
{
string nombreActual = nombres.at(i);
// También podría ser con:
// nombreActual = nombres[i]
cout << "Un nombre: " << nombreActual << endl;
}
array<int, 5> numeros = {1, 2, 3, 4, 5};
for (size_t i = 0; i < numeros.size(); i++)
{
int numeroActual = numeros[i];
cout << "Un número: " << numeroActual << endl;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment