Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Borland continues its support of C++

Status
Not open for further replies.

2ffat

Programmer
Oct 23, 1998
4,811
US

James P. Cottingham
-----------------------------------------
[sup]To determine how long it will take to write and debug a program, take your best estimate, multiply that by two, add one, and convert to the next higher units.[/sup]
 
Here is transcript of the lastest BDNTV broadcast regarding BCB: . Some interesting developments, including proposed support of Crystal Reports and one IDE for Delphi, C++, & C#.

James P. Cottingham
-----------------------------------------
[sup]To determine how long it will take to write and debug a program, take your best estimate, multiply that by two, add one, and convert to the next higher units.[/sup]
 
I just compiled a program I created to compute a product in the form of a fraction and a decimal from two fractions. When I builded it, it came out with error message "[C++ Error] Unit1.cpp(37): E2277 Lvalue required". I have tried everything in my knowledge to fix this. What does this mean and how can i fix this error?
Here is my code:
#include <iostream>
using namespace std;

int main()
{
int num1, deno1; //input: numerator and denominator for the first fraction
int num2, deno2; //input: numerator and denominator for the second fraction
float dec; //ouput: the prodcut of the two fractions in decimal form
const int newfrac = ( num1 * num2 ) / ( deno1 * deno2 ); /* output: the
product of the two fractions in fraction form */

//Enter the first numerator.
cout << "Enter the first numerator: ";
cin >> num1;

//Enter the first denominator.
cout << "Enter the first denominator: ";
cin >> deno1;

//Enter the second numerator.
cout << "Enter the second numerator: ";
cin >> num2;

//Enter the second denominator.
cout << "Enter the second denominator: ";
cin >> deno2;

//Compute the product in fraction form.
( num1 * num2 ) / ( deno1 * deno2 )= num1 / deno1 * num2 / deno2;

//Compute the product in decimal form.
dec = num1 / deno1 * num2 / deno2;

//Display the product in fraction form
cout << "The product in fraction form is " << newfrac << endl;

//Display the product in decimal form
cout << "The product in decimal form is " << dec << endl;

system ("pause");

return 0;

}

The error message is in regards to this statement as stated by the program (Borland):
( num1 * num2 ) / ( deno1 * deno2 )= num1 / deno1 * num2 / deno2;

Thanks for your help!

-Chris
 
Well, first of all this is not rigth place to post it, you should have started a new thread.

Next: Unit1.cpp(37) means that in the file "Unit1.cpp", line 37 the value that recieves the value needs to be a variable.

This means that if you declares:
const inte Result = 0;
and then does:
Result = X + Y;
it will give that type of error that you get.
"Result" is not a value that you can give a value in runtime, it's a constant, also if you uses a variable that's #declare it vould give this error.

So the code of main() is totally irrelevant, look at line 37 of Unit1.cpp and you will see the error.

Totte
Keep making it perfect and it will end up broken.
 
survey for what you want to happen in the next version of builder for borland.


in the part where they if you could fix just one thing. why not ask for more compatibility with delphi. that way whenever you try a delphi component itll have more chance of working.
 
HI all,

Is there a simple function in BCB v5.0 that will tell me the size of a file. I do not want to resort to the Win 32 API.

Basically I just want to check that a file has content - ie it is not a ZERO byte file !
hanks,

Steven Matthews
 
Your best bet is to start a new thread but off the top of my head, look in your help file for filelength.


James P. Cottingham
-----------------------------------------
[sup]To determine how long it will take to write and debug a program, take your best estimate, multiply that by two, add one, and convert to the next higher units.[/sup]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top