I seem to be getting a segmentation fault in my array. When I run it the the TF and TC appear at the top then the array. That's when the error occurs. I tried debugging it and when tf = 10 the error was occuring. Can someone help plz.
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
int tf = 0;
int r = 0;
double array[r][1];
cout << "TF TC" << endl;
while(tf <=100) {
for(r=0; r < 20; r++) {
array[r][0] = tf;
array[r][1] = tf * (5/9) -32;
tf+=5;
r++;
}
}
for(int r=0;r<20;r++) {
cout << array[r][0] << setw(5) << array[r][1];
}
system("PAUSE");
return 0;
}