Answers for "array cpp"

C++
1

c++ array

string cars[4] = {"Volvo", "BMW", "Ford", "Mazda"};
cout << cars[0];
// Outputs Volvo
Posted by: Guest on November-06-2021
0

creare array con c++

#include <iostream>
int main()
{
int myArray[] {2, 4, 6, 8, 10};
for (int i=0; i<5; i++)
{
std::cout << "index: " << i << " - value: " << myArray[i] << "n";
}
return 0;
}
Posted by: Guest on March-31-2020
-2

array c++

// An example of using std::array
// Basic syntax: std::array<TYPE, SIZE> NAME;
// Note that the size must be a constant

#include <iostream>
#include <array> // Use std::array

int main() {
	std::array<int, 10> arr;
  	arr[0] = 5; // Setting an element
  	std::cout << arr[0] << std::endl; // Element access
  	std::cout << arr.at(0) << std::endl; // Element access with bounds checking
}
Posted by: Guest on February-01-2021
0

c++ array

const int len = 3;
int arr[len];

arr[0] = 4;

int abc[4]{0,12,3}
Posted by: Guest on November-03-2020
0

array in c++

char century [100][365][24][60][60];
Posted by: Guest on September-20-2021
0

array in c++

int jimmy [3][5];
Posted by: Guest on September-20-2021

Browse Popular Code Answers by Language