i have made a function “1” and I want to ask user “Do you want to repeat function “1”?”, what am I doing wrong? Here is my code:
#include <cstdlib>
#include <iostream>
using namespace std;
void temperature()
{
float c,f;
cout<<"Áveskite temperatørà pagal Celsijø: ";
cin>>c;
f=(c*1.8)+32;
cout<<"Temperatûra pagal Farenheità: ";
printf("%2.2f", f);
cout<<endl;
}
int main()
{
setlocale(LC_ALL,"Lithuanian");
temperature();
char isjungti;
cout<<"Paversti dar vienà temperatûrà?(T)";
cin>>isjungti;
if(isjungti == 'T' || 't')
{
return temperature(); //I get an error here.
}
system("PAUSE");
return EXIT_SUCCESS;
}
Thanks for help.
returnwill exit the function scope. Use something likeOr similar.