TotalView C Serial Exercise 2 - Assignment

Assignment

In this assignment, use TotalView to locate an error in the following program. The program is crashing with a segmentation fault.

#include <stdio.h>
int main()
{
     float vec[10];
     int i;

     for (i=0;i<10;i++){
       vec[i]=2.0*i;
     }

     i=100000;

     printf("%f", vec[i]);
     printf("
All Done
");

     return 0;
}