ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello I have hit a road block Iam trying to teach myself C++ with some books etc. I was told to write a program but everytime I try to compile I get the following error.
cout << farhrenheit << end1; the application is telling me that it is not declared
If you can please help me I am really dumbfounded. thanks again.
Ok I went over it, I corrected it but I still get error, this is what I have
//
// Program to convert temperature from Celsius degree
// units into Fahrenheit degree units:
// Fahrenheit = Celsius * (212 - 32)/100 + 32
//
#include <cstdio>
#include <cstlib>
#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 to convert Celsius
//into Fahrenheit values
int fahrenheit;
int fahrenheit = factor * celsius/100 + 32;
//output the results (followed by a Newline)
cout << "Fahrenheit value is:";
cout << farhrenheit << endl;
//wait until user is ready before terminating program
// to allow the user to see the program results
system("PAUSE");
return 0;
}
if you can please enlighten me I would appreciate it. Thanks so much
Thanks for the response yet again I am not at home so I have not had the chance to correct that to see of that will resolve the issue, but I am sure that it will. This is really painstaking and humorous thanks.
Well I adjusted the error but while I compile it says the following:
c:\documents and settings\owner\my documents\fahrenhiet.cpp(7) : fatal error C1083: Cannot open include file: 'cstlib': No such file or directory
Error executing cl.exe.
When I was instructed to write this program I was told to include the
#include <cstlib>
line, yet it seems to be missing it? Is there something that I should include? Thanks again
Originally posted by inescapeableus Well I adjusted the error but while I compile it says the following:
c:\documents and settings\owner\my documents\fahrenhiet.cpp(7) : fatal error C1083: Cannot open include file: 'cstlib': No such file or directory
Error executing cl.exe.
When I was instructed to write this program I was told to include the
#include <cstlib>
line, yet it seems to be missing it? Is there something that I should include? Thanks again
That should be:
#include <cstdlib>
I don't mean to sound rude, by why don't you check for typos before you post your problems? Its mildy irritating to hear people tell you "its a typo" numerous times.
Yeah I know I am sorry for asking again, I should go over it a little better I just am such a newbie I went over it (to me it looked fine) but I suppose I was wrong, thanks for your critic.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.