//Set number for num_nodes to 11 for degree 10 polynomial
int num_nodes = 11;
//Set interval and Create increment for each x value
double a=0,b=2;
double increment = (b-a)/num_nodes;
//Create arrays to store x,y, and polynomial vals
std::vector<double> nodes_arrayx(num_nodes,0);
std::vector<double> nodes_arrayy(num_nodes,0);
std::vector<double> polynomial(num_nodes,0);
//Populate Node Arrays
for(int i=0;i<num_nodes;i++)
{
nodes_arrayx[i] = a + (i*increment);
nodes_arrayy[i] = exp(nodes_arrayx[i]);
std::cout << "\nNode " << i << " (x,y) is: (" << nodes_arrayx[i] << ',' << nodes_arrayy[i]<<')';
//I added a second line here to verify this is where the segfault is. The second is an exact copy of the first, but for some reason it causes segfault on i=10
std::cout << "\nNode " << i << " (x,y) is: (" << nodes_arrayx[i] << ',' << nodes_arrayy[i]<<')';
I isolated to the lines with std::cout, with the second being an exact copy of the first (as noted in code). Just before the segfault, it runs fine with the first line then stops.