Sorry I pasted an earlier code before fixing it, this one compiles but I can't figure out how to make the values go through my function, or if I made it correctly to change input from user into celsius.
Code:
// Computer Lab test.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
using namespace std;
double c;
double celsius;
double CheckCent(double c)
{
if ( c>30 )
{
return 1.8 * celsius + 32;
}
return c;
}
// call this function to convert celsius to fahrenheit (function name is convert)
int _tmain(int argc, _TCHAR* argv[])
{
double myarray[51];
//double i;
int flag;
flag=1;
int i;
for(i = 0; i < 51 && flag == 1; i++)
{ // Loop to enter temperatures - pressing 1 continues, pressing 0 stops //
cout << "Enter Temperature Reading:";
cin >>myarray[i];
cout << "Enter 1 to input more values, 0 to stop";
cin >>flag;
}// End for
cout << "Number of elements in the array is: " << i;
cout <<"\n";
return 0;
}