get the first element of array c++
int arr = [1,2,3,4];
cout << arr[0]; //printing the first element of the array arr
get the first element of array c++
int arr = [1,2,3,4];
cout << arr[0]; //printing the first element of the array arr
How to get the last element of an array in C++ using std::array
#include <array>
std::array<int, 5> a {1, 2, 3, 4, 5};
int i = a[a.size() - 1]; // The last variable stored in i
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us