if I only want to print int array in CPP , what is the better impelemnt (and why) ?
for (const auto& x : { 1,2,3,4 })
{
cout << x<< endl;
}
or
for (int x : { 1, 2, 3, 4 })
{
cout << x << endl;
}
if I only want to print int array in CPP , what is the better impelemnt (and why) ?
for (const auto& x : { 1,2,3,4 })
{
cout << x<< endl;
}
or
for (int x : { 1, 2, 3, 4 })
{
cout << x << endl;
}