The loop is supposed to ask for the name, year and address of three persons. After the input of the third name, the execution of the program ends and I'm not able to enter the last year and address.
#include <iostream>
int main(){
std::string Names[2]={};
unsigned int Years[2]={};
std::string Address[2]={};
for(int i=0;i<=2;i++){
std::cout<<"Enter name >> ";
std::cin>>Names[i];
std::cout<<"Enter year >> ";
std::cin>>Years[i];
std::cout<<"Enter address >> ";
std::cin>>Address[i];
}
return 0;
}