problem with cout

Hi guys, I just started learning C++ and I wrote my first program but when I execute it none of my cout statements appear and all I get is a message saying "press any key to continue"

Here is my code:

//
// 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[])
{
int celsius;
cout <<"enter the temp in celsius:";
cin >> celsius;

int factor;
factor = 212 - 32;

int fahrenheit;
fahrenheit = factor * celsius/100 + 32;

cout << "the fahrenheit value is:";
cout << fahrenheit << endl;

system("PAUSE");
return 0;
}
closed account (zb0S216C)
It's works with my compiler. Which compiler are you using?

Wazzak
I'm going make a shot in the dark and ask this silly question... are you sure your executable is up-to-date?

-Albatross
I'm using bloodshed's Dev-C++ 4.9.9.2

how would I know if my executable is up-to-date?

This sounds like an issue I have with Code::Blocks from time to time. Delete the executable and see if compiling again recreates it. It may be compiling to another directory.
closed account (zb0S216C)
wagnerag wrote:
how would I know if my executable is up-to-date?

Rebuilding your project will update your object files.

Here's a piece of advice you may wan't to consider: Don't use Dev-C++.

Wazzak
Last edited on
I have a 64 bit operating system, could this be the problem?
closed account (zb0S216C)
wagnerag wrote:
I have a 64 bit operating system, could this be the problem?

In your case, no.

Wazzak
Actually Dev-C++ would not have downloaded the latest Mingw, so although it may not be an issue now it could cause problems in the future. Here's an up date: http://wxdsgn.sourceforge.net/
I think I got it figured out, thanks for the help!
Ok... What was it?
when I created the project I clicked on windows application instead of the console application. Stupid error, I know.
Topic archived. No new replies allowed.