| | |
Understanding Syntax errors for C++
Please support our C++ advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Aug 2005
Posts: 1
Reputation:
Solved Threads: 0
I'm using a program called Dev C++. Sometimes I am able to solve the syntax erros and sometimes I am not able to do so cause I do not understand it although it's logical.
There is an error message which displays "warning: assignment to 'int' from 'double'".
I had to write a program using 4 arrays that are passed into multiple functions. In my program I had to calculate Kilometers per liter and to calculate it I had to first convert miles to Kilometers and convert gallons to liter than dividing the two to obtain the km per liter. Miles and gallons are declared as int arrays and the constant km and liter are declared automatically as double using '#define' so any suggestions!!!!!!
There is an error message which displays "warning: assignment to 'int' from 'double'".
I had to write a program using 4 arrays that are passed into multiple functions. In my program I had to calculate Kilometers per liter and to calculate it I had to first convert miles to Kilometers and convert gallons to liter than dividing the two to obtain the km per liter. Miles and gallons are declared as int arrays and the constant km and liter are declared automatically as double using '#define' so any suggestions!!!!!!
>There is an error message which displays "warning: assignment to 'int' from 'double'".
That's not an error, it's a warning. It's telling you that the fractional part of a floating-point value will be truncated when you assign it to an integer variable. You fix it by using doubles instead of ints.
That's not an error, it's a warning. It's telling you that the fractional part of a floating-point value will be truncated when you assign it to an integer variable. You fix it by using doubles instead of ints.
New members chased away this month: 5
![]() |
Similar Threads
- syntax errors and the check module command? (Python)
- Need help with some syntax errors (C++)
- Double Arrays HELP!!!!!! (C++)
- Simple Programming Errors (Computer Science)
Other Threads in the C++ Forum
- Previous Thread: The use of o- & istream???
- Next Thread: How do Imodify my random number generator?
Views: 1666 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for C++
6 api application array arrays assignment based beginner binary c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count data database delete developer display dll dynamiccharacterarray email encryption error file format forms fstream function functions game generator givemetehcodez graph iamthwee ifstream image input int java lib list loop looping loops map math matrix memory multidimensional multiple newbie news number numbertoword output pointer problem program programming project python random read recursion recursive reference return rpg search sort sorting string strings struct template templates text tree url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets






