Hello everyone,
I'm working on a function reading data from file.
I am getting an error: E2110 Incompatible type conversion
Here is what i have:
function in the form:
	The function itself in class Food:
	What is wrong here???
							
						
					I'm working on a function reading data from file.
I am getting an error: E2110 Incompatible type conversion
Here is what i have:
function in the form:
Code:
	
void __fastcall TForm1::EnterProductFromFileClick(TObject *Sender)
{
        char ProductName[256]="";
        int ProductID;
        float Weight;
        char WeightCategory[256]="";
        float PriceWithoutVAT;
        float PriceWithVAT;
        char ExpiryDate[256]="";
        int AmountInStock;
        int ReorderLimit;
        char ProductCategory[256]="";
        char InputDate[256]="";
        char DueDate[256]="";
        char Manufacturer[256]="";
        char ManufacturerAddress[256]="";
        char OriginCountry[256]="";
        myProductList.getFoodProduct(i)->
ReadDataFromFile(ProductName, ProductID, Weight, WeightCategory,
                                   PriceWithoutVAT, PriceWithVAT, ExpiryDate,
                         AmountInStock, ReorderLimit, ProductCategory,
InputDate, DueDate, Manufacturer, ManufacturerAddress,OriginCountry); 
                    //error in the last line
Code:
	void Food :: ReadDataFromFile(char *ProductName,int &ProductID, 
                                  float &Weight, char *WeightCategory,
                                   float &PriceWithoutVAT, float &PriceWithVAT, 
                                  char *ExpiryDate, int &AmountInStock,
                                  int &ReorderLimit, char *ProductCategory,
                                   char *InputDate, char *DueDate,char *Manufacturer,
                                   char *ManufacturerAddress, char *OriginCountry)
{
        ifstream inputfile;
        inputfile.open("input.txt");
         char check[256]="";
             while(inputfile>>check)
              {
                     inputfile>>ProductID;
                     inputfile>>ProductName;
                     inputfile>>Weight;
                     inputfile>>WeightCategory;
                     inputfile>>ExpiryDate;
                     inputfile>>PriceWithoutVAT;
                     PriceWithVAT = CalculateVATPrice(PriceWithoutVAT);
                     inputfile>>AmountInStock;
                     inputfile>>ReorderLimit;
                     inputfile>>ProductCategory;
                     inputfile>>InputDate;
                     inputfile>>DueDate;
                     inputfile>>Manufacturer;
                     inputfile>>ManufacturerAddress;
                     inputfile>>OriginCountry;
                };
        inputfile.close();
}
 
	
Comment