-
Hi all,
I'm new to QT and I'm trying simple examples to practice with this great tool.
After some work with this tool I have a "simple" problem with the the console and cin.
I did a simple program where I have to input a number (Celsius degree) and the program converts to Fahrenheit after I press ENTER key.
The program runs perfectly if I use the terminal of OSX SIERRA but if I use the console, cout shows a message correctly to enter a number but after I do it and press the enter key the program doesn't return the result and "freezes".
Is there any way to use the console instead the terminal of OS X?
Thanks in advance.
The program:
// Program to convert temperature from Celsius degree
// units into Fahrenheit degree units:
// Fahrenheit = Celsius * (212 - 32)/100 + 32 //
#include <cstdio>
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int nNumberofArgs, char* pszArgs[])
{
// enter the temperature in Celsius
int celsius;
cout << "Enter the temperature in Celsius:";
cin >> celsius;
// calculate conversion factor for Celsius to Fahrenheit
int factor;
factor = 212 - 32;
// use conversion factor to convert Celsius into Fahrenheit values
int fahrenheit;
fahrenheit = factor * celsius/100 + 32;
// output the results (followed by a NewLine)
cout << "Fahrenheit value is:";
cout << fahrenheit << endl;
// wait until user is ready before terminating program to allow the user to see the program results system(“PAUSE”);
return 0;
} -
Hi and welcome to devnet,
What do you mean by console ?
-
With console I mean the application output of QT.
As I said it shows the text "Enter the temperature in Celsius:" correctly but doesn't do nothing when I write a number and press enter key. -
Thanks to all. Definitively you can't input anything through the console so I have to use the terminal.
One thing I find horrible is that when I run a simple app, QT launches the terminal but there is a very long message and I was asking if there is a way to avoid it.
I attach a capture, there you can see what shows the terminal when is launched by QT.
-
Thanks to all. Definitively you can't input anything through the console so I have to use the terminal.
One thing I find horrible is that when I run a simple app, QT launches the terminal but there is a very long message and I was asking if there is a way to avoid it.
I attach a capture, there you can see what shows the terminal when is launched by QT.
-
Hello! I have similar problem, I checked terminal and getting this error
Please advise how to fix:
:-1: error: cannot open output file release\writeToDat.exe: Permission denied -
Hello! I have similar problem, I checked terminal and getting this error
Please advise how to fix:
:-1: error: cannot open output file release\writeToDat.exe: Permission denied@icebergenergy
Doesn't sound like anything related to this issue.
Assumingrelease\writeToDat.exe
is your executable and the right path to it, have you looked to see whether you already have that executable running, perhaps left over from when you ran it outside of Creator? Use Task Manager to have a look at what processes are running. Restart your PC and see whether error has gone away. -
yeah! Already solved. Thanks. I had run it without building