Sponsored Content
Full Discussion: Feof
Top Forums Programming Feof Post 11414 by shaik786 on Wednesday 5th of December 2001 12:22:03 AM
Old 12-05-2001
Hi!

Replace your code with:

#include [stdio.h]
FILE *invfile;
int prod, qty;
float price;

void main()
{
invfile = fopen("file.dat","r");
while(fscanf(invfile,"%d %d %f", &prod, &qty, &price) != EOF)
{
printf("Product No. = %d\n",prod);
printf("Quantity = %d\n",qty);
printf("Price = %.2f\n\n",price);
}
fclose(invfile);
}

Rgds
SHAIK
shaik786
 
Bonds(1)						      General Commands Manual							  Bonds(1)

NAME
Bonds - Example of bond pricing SYNOPSIS
Bonds DESCRIPTION
Bonds is an example of using QuantLib. It shows how to set up a term structure and then price some simple bonds. The last part is dedicated to peripherical computations such as yield-to-price or price-to-yield. SEE ALSO
The source code Bonds.cpp, BermudanSwaption(1), CallableBonds(1), CDS(1), ConvertibleBonds(1), DiscreteHedging(1), EquityOption(1), Fitted- BondCurve(1), FRA(1), MarketModels(1), Replication(1), Repo(1), SwapValuation(1), the QuantLib documentation and website at http://quantlib.org. AUTHORS
The QuantLib Group (see Authors.txt). This manual page was added by Luigi Ballabio . QuantLib 22 October 2008 Bonds(1)
All times are GMT -4. The time now is 06:45 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy