Speciale
Disabled
- Joined
- May 29, 2005
- Location
- woodstock illinois
I'm trying to slowly teach myself some basic C++ programming. A few years ago i bought C++ for dummies...it was the easiest of the lot to read and so i figured it was a good place to start (all the other books kind of made it seem like you needed some sort of backround).
At any rate it came with a compiler and the programs it has you program worked fine. I lost that disk and now use i'm using C++ visual express, and i've tried another free one from the web.
The very first program:
When i try and compile it i get this error:
originally it is suppose to be
And i get the same error. It's my understanding that the iostream.h and stdio.h define cin and cout...am i right?
I've tried to look them up online and they seem very common, it seems that this should work. Someone want to explain to me where the error is??
At any rate it came with a compiler and the programs it has you program worked fine. I lost that disk and now use i'm using C++ visual express, and i've tried another free one from the web.
The very first program:
Code:
//
// Program to convert temperature from Celsius degree
// units into Fahrenheit degree units:
// Fahrenheit = Celsius * (212 - 32)/100 + 32
//
#include <stdio>
#include <iostream>
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 fahreneit;
fahrenheit = factor * celsius/100 + 32;
// output the results
cout << "Fahrenheit value is:";
cout << fahrenheit;
return 0;
}
When i try and compile it i get this error:
------ Build started: Project: C++, Configuration: Debug Win32 ------
Compiling...
temp conversion.cpp
.\temp conversion.cpp(7) : fatal error C1083: Cannot open include file: 'stdio': No such file or directory
Build log was saved at "file://c:\Documents and Settings\Tim\My Documents\Visual Studio 2005\Projects\C++\C++\Debug\BuildLog.htm"
C++ - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
originally it is suppose to be
Code:
#include <iostream.h>
#include <stdio.h>
And i get the same error. It's my understanding that the iostream.h and stdio.h define cin and cout...am i right?
I've tried to look them up online and they seem very common, it seems that this should work. Someone want to explain to me where the error is??