Apr 3, 2013 at 12:30pm UTC  
You do not initialize *order before calling readOrder, you do that directly afterwards.
 
Apr 3, 2013 at 1:03pm UTC  
1void  readOrder( OrderList *&order , int  &orderIndex ){
    ifstream inFile;
    string name = "" ;
    string item = "" ;
    string status = "" ;
	string model = "" ;
    int  quan = 0;
    double  price = 0.00;
	inFile.open("order.txt" );
	if ( inFile.fail() )
		cout << "Unable to open file "  << endl;
	inFile >> orderIndex;  
	order = new  OrderList[orderIndex+1];
    for ( int  i = 0 ; i < orderIndex ; i++){
		
        getline( inFile , name );
        order[i].setCompanyName(name);
        getline( inFile , item );
        order[i].setItemName( item );
		getline( inFile , model );
		order[i].setModelName( model );
       
        inFile >> price;
        order[i].setPrice( price );
        inFile >> quan;
        order[i].setQuantity( quan );
        
        getline( inFile , status );
        order[i].setOrderStatus( status );
		
    }
}
why i read file my file output will be like this
12
Kezn
Hitachi
0
0
Jye
LG
LG-ST-244/TV
2
11998
pending
the second correct but why first 1 wrong and run 
 
Last edited on Apr 3, 2013 at 1:16pm UTC  
 
Apr 3, 2013 at 1:18pm UTC  
remove the & in OrderList *&order
 
Apr 3, 2013 at 1:36pm UTC  
No, you'll need to dereference order in the readOrder function like so:(*order)(*order)[i].setItemName(...);OrderList &orderreadOrder( *order ,inFile , orderIndex );
 
Apr 3, 2013 at 1:58pm UTC  
solved it.