I don't understand what I'm doing wrong. My code should just increment i: 0.1 from zero, and add 0.5 to each position, really simple, but instead I get segmentation fault (core dumped).
Can someone give me hand?
vector<float> sinal;
int main(){
  sinal[0] = 0;
  for (float i = 0.1; i <= 1; i += 0.1){
    sinal[i] = sinal[i - 1] + 0.5;
    if (i == 1){
      break;
    }
    cout << "\n" << sinal[i];
  }
getchar();
cin.get();
}
 
 
    