473,387 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Error message ..please help

I wrote the program and the complier at school is Microsoft Visual 6.0.......but i keep getting one error message and i have no idea what it means...i bolded the line where it occurs n the error message i get....the program is supposed to read n a text date file with 101 altitudes incrementing by 1000 and for each there is a specific temp, pressure, and density......these values are supposed to be stored in 4 one dimensional arrays.....


# include<fstream.h>
# include<iostream.h>
# include<stdio.h>
# include<math.h>
# include<stdlib.h>

main()
{
double alt[105],temp[105],rho[105],press[105],desalt[105];
double z = 0.0f;
double p = 0.0f;
double t = 0.0f;
double r = 0.0f;
int i, ie;
char c, q, input;

ifstream inf;
inf.open("atm7.txt",ios::in);
i=1;

while (!inf.eof())
{
inf>>alt[i]>>temp[i]>>rho[i]>>press[i];
i++;
}
ie=i-1;

L1:;
printf("Enter Desired altitude: ");
error C2679: binary '>>' : no operator defined which takes a right-hand
operand of type 'double [105]' (or there is no acceptable conversion)
--------> cin>> desalt>>endl; printf("Desire altitude: ");
cout<<desalt<<endl;

for(i = 0; (i <=100000) && (alt[i]<= z); i+=1000);
{
t= temp[i] +(z-alt[i])*(temp[i+1]-temp[i])/(alt[i+1]-alt[i]);
r= rho[i] +(z-alt[i])*(rho[i+1]-rho[i])/(alt[i+1]-alt[i]);
p= press[i] +(z-alt[i])*(press[i+1]-press[i])/(alt[i+1]-alt[i]);

printf("Altitude (ft):\t");
cout<<alt <<endl;
printf("Pressure (lb per in^2):\t");
cout<< p <<endl;
printf("Temperature (F):\t");
cout<< t <<endl;
printf("Density (lb per ft^3):\t");
cout<< r <<endl;
}

do

{
printf("Do you wish to continue or quit?");
cin >> input;
}
while(input!='q'); goto L1;


return 0;

}
Oct 14 '06 #1
1 1705
vermarajeev
180 100+
you have declared desalt as an array of doubles and you cannot use cin>>desalt;

Either use one loop and accept values
like this
for(int j=0; j<some_val; ++j)
cin>>desalt[j];

or declare desalt as just double like this
Expand|Select|Wrap|Line Numbers
  1. double desalt
Thanks
Oct 14 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Squirrel | last post by:
I have a command button on a subform to delete a record. The only statement in the subroutine is: DoCmd.RunCommand acCmdDeleteRecord The subform's recordsource is "select * from tblVisit order...
7
by: tyler_durden | last post by:
thanks a lot for all your help..I'm really appreciated... with all the help I've been getting in forums I've been able to continue my program and it's almost done, but I'm having a big problem that...
8
by: sudha | last post by:
Hi, To open a word doc from c#, i use the following code : Word.ApplicationClass WordApp = new Word.ApplicationClass (); // give any file name of your choice. object fileName =...
7
by: p | last post by:
WE had a Crystal 8 WebApp using vs 2002 which we upgraded to VS2003. I also have Crystal 9 pro on my development machine. The web app runs fine on my dev machine but am having problems deploying....
4
by: VB Programmer | last post by:
If I try ANY aspx pages on my server, even INVALID, bogus pages, I get a "Runtime Error". Any idea why? Here is the full message: Server Error in '/' Application....
8
by: Rod | last post by:
I have been working with ASP.NET 1.1 for quite a while now. For some reason, opening some ASP.NET applications we wrote is producing the following error message: "The Web server reported...
6
by: ST | last post by:
Hi, I keep getting the parser error, and I have no idea why. I've tried a number of things including: 1)building/rebuilding about 100x 2)making sure all dll's are in the bin folder in the root...
10
by: Rider | last post by:
Hi, simple(?) question about asp.net configuration.. I've installed ASP.NET 2.0 QuickStart Sample successfully. But, When I'm first start application the follow message shown. ========= Server...
2
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.