本文整理汇总了C++中Fprintf函数的典型用法代码示例。如果您正苦于以下问题:C++ Fprintf函数的具体用法?C++ Fprintf怎么用?C++ Fprintf使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Fprintf函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MOD_OPT
int MOD_OPT(ChkMix)(Option *Opt,Model *Mod)
{
TYPEOPT* ptOpt=( TYPEOPT*)(Opt->TypeOpt);
TYPEMOD* ptMod=( TYPEMOD*)(Mod->TypeModel);
int status=OK;
if (ptOpt->Maturity.Val.V_DATE<=ptMod->T.Val.V_DATE)
{
Fprintf(TOSCREENANDFILE,"Current date greater than maturity!\n");
status+=1;
};
if ((ptOpt->DownOrUp).Val.V_BOOL==DOWN)
{
if ( ((ptOpt->Limit.Val.V_NUMFUNC_1)->Compute)((ptOpt->Limit.Val.V_NUMFUNC_1)->Par,ptMod->T.Val.V_DATE)>ptMod->S0.Val.V_PDOUBLE)
{
Fprintf(TOSCREENANDFILE,"Limit Down greater than spot!\n");
status+=1;
};
}
if ((ptOpt->DownOrUp).Val.V_BOOL==UP)
{
if ( ((ptOpt->Limit.Val.V_NUMFUNC_1)->Compute)((ptOpt->Limit.Val.V_NUMFUNC_1)->Par,ptMod->T.Val.V_DATE)<ptMod->S0.Val.V_PDOUBLE)
{
Fprintf(TOSCREENANDFILE,"Limit Up lower than spot!\n");
status+=1;
};
}
return status;
}
示例2: MOD_OPT
int MOD_OPT(ChkMix)(Option *Opt,Model *Mod)
{
TYPEOPT* ptOpt=( TYPEOPT*)(Opt->TypeOpt);
TYPEMOD* ptMod=( TYPEMOD*)(Mod->TypeModel);
int status=OK;
if (ptOpt->Maturity.Val.V_DATE<=ptMod->T.Val.V_DATE)
{
Fprintf(TOSCREENANDFILE,"Current date greater than maturity!\n");
status+=1;
};
if ((ptOpt->MinOrElse).Val.V_BOOL==MINIMUM)
{
if ((ptOpt->PathDep.Val.V_NUMFUNC_2)->Par[4].Val.V_PDOUBLE>ptMod->S0.Val.V_PDOUBLE)
{
Fprintf(TOSCREENANDFILE,"Minimum greater than spot!\n");
status+=1;
};
}
if ((ptOpt->MinOrElse).Val.V_BOOL==MAXIMUM)
{
if ((ptOpt->PathDep.Val.V_NUMFUNC_2)->Par[4].Val.V_PDOUBLE<ptMod->S0.Val.V_PDOUBLE)
{
Fprintf(TOSCREENANDFILE,"Maximum lower than spot!\n");
status+=1;
};
}
return status;
}
示例3: WriteListAnalysis
void WriteListAnalysis(FILE * f, int i, char *list_type)
{
int k, i1;
VARPTR var;
i1 = i + 1;
AddDeclare1(DEC_INT, "m%d", i1);
AddDeclare1(DEC_INT, "n%d", i1);
AddDeclare1(DEC_INT, "l%d", i1);
Fprintf(f, indent, "GetRhsVar(%d,\"%s\",&m%d,&n%d,&l%d);\n", i1, list_type, i1, i1, i1);
for (k = 0; k < nVariable; k++)
{
var = variables[k];
if ((var->list_el != 0) && (strcmp(var->list_name, variables[i]->name) == 0) && var->present)
{
Fprintf(f, indent, "/* list element %d %s */\n", var->list_el, var->name);
if (RHSTAB[var->type].type != var->type)
{
fprintf(stderr, "Bug in intersci : Something wrong in RHSTAB\n");
}
(*(RHSTAB[var->type].fonc)) (f, var, 0);
}
}
}
示例4: PrintList_hkl
static void PrintList_hkl(void)
{
int iListFcal;
T_ListFcal *lfcal;
Fprec d, twotheta;
Fprintf(stdout, ">Begin List_hkl\n");
Fprintf(stdout, "# h k l d 2-Theta\n");
lfcal = ListFcal;
for (iListFcal = 0; iListFcal < nListFcal; iListFcal++)
{
if (lfcal->h || lfcal->k || lfcal->l)
{
twotheta = TwoThetaDeg(lfcal->Q);
d = lfcal->Q; if (d != 0) d = 1. / sqrt(d);
Fprintf(stdout, " %3d %3d %3d %8.4f %7.3f",
lfcal->h, lfcal->k, lfcal->l, d, twotheta);
putc('\n', stdout);
}
lfcal++;
}
Fprintf(stdout, ">End List_hkl\n");
putc('\n', stdout);
}
示例5: MOD_OPT
int MOD_OPT(ChkMix)(Option *Opt,Model *Mod)
{
TYPEOPT* ptOpt=(TYPEOPT*)(Opt->TypeOpt);
TYPEMOD* ptMod=(TYPEMOD*)(Mod->TypeModel);
int status=OK;
/*Custom*/
if (ptOpt->Maturity.Val.V_DATE<=ptMod->T.Val.V_DATE)
{
Fprintf(TOSCREENANDFILE,"Current date greater than maturity!\n");
status+=1;
};
if ( ((ptOpt->LowerLimit.Val.V_NUMFUNC_1)->Compute)((ptOpt->LowerLimit.Val.V_NUMFUNC_1)->Par,ptMod->T.Val.V_DATE)>ptMod->S0.Val.V_PDOUBLE && (ptOpt->Parisian).Val.V_BOOL==WRONG)
{
Fprintf(TOSCREENANDFILE,"Limit Down greater than spot!\n");
status+=1;
};
if ( ((ptOpt->UpperLimit.Val.V_NUMFUNC_1)->Compute)((ptOpt->UpperLimit.Val.V_NUMFUNC_1)->Par,ptMod->T.Val.V_DATE)<ptMod->S0.Val.V_PDOUBLE && (ptOpt->Parisian).Val.V_BOOL==WRONG)
{
Fprintf(TOSCREENANDFILE,"Limit Up lower than spot!\n");
status+=1;
};
/*EndCustom*/
return status;
}
示例6: PrintPhaseCode
static void PrintPhaseCode(T_PhaseCode *code)
{
int iCT, iTab;
static int TabSymbol[] =
{
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'-', 'i', 'h', 'g', 'f', 'e', 'd', 'c', 'b', 'a',
'0'
};
Fprintf(stdout, "PhaseCode(");
for (iCT = 0; iCT < nActivePhase; iCT++)
{
if (iCT % 72 == 0) putc('\n', stdout);
iTab = (code[iCT] + 9) / 18;
if (iTab >= 0 && iTab < (sizeof TabSymbol / sizeof (*TabSymbol)))
putc(TabSymbol[iTab], stdout);
else
putc('~', stdout);
}
Fprintf(stdout, "\n)");
}
示例7: FSelectPricing
int FSelectPricing(char InputFile[MAX_LINE][MAX_CHAR_LINE],int user,Model *pt_model,Option *pt_option,Pricing **pricing,Pricing **result)
{
int i=-1;
char dummy[MAX_CHAR_X3];
if ((strlen(pt_model->ID)+1+strlen(pt_option->ID))>=MAX_CHAR_X3)
{
Fprintf(TOSCREEN,"%s\n",error_msg[PATH_TOO_LONG]);
exit(WRONG);
}
strcpy(dummy,pt_model->ID);
strcat(dummy,"_");
strcat(dummy,pt_option->ID);
do
{
i=i+1;
}
while ((strcmp(dummy,pricing[i]->ID)!=0) && (pricing[i+1]!=NULL));
if (strcmp(dummy,pricing[i]->ID)==0)
{
*result=pricing[i];
return ((*result)->CheckMixing)(pt_option,pt_model) ;
}
Fprintf(TOSCREEN,"No choice available!\n");
return PREMIA_NONE;
}
示例8: VRML_Begin
void VRML_Begin( FILE *f )
{
fprintf( f, VRML_header );
fprintf( f, "children [\n" );
Fprintf( f, "\t\tNavigationInfo { headlight FALSE }\n" );
Fprintf( f, "\t\tDirectionalLight {\n\t\t direction 0 -5 1 }\n\n" );
}
示例9: large_deflate
u_long large_deflate (u_char *compr, u_long compr_len,
u_char *uncompr, u_long uncompr_len) {
z_stream c_stream; /* compression stream */
int err;
c_stream.zalloc = (alloc_func)0;
c_stream.zfree = (free_func)0;
c_stream.opaque = (voidpf)0;
err = deflateInit(&c_stream, Z_BEST_SPEED);
if (check_error(err, "deflateInit", c_stream.msg)) return 0;
c_stream.next_out = compr;
c_stream.avail_out = (u_int)compr_len;
c_stream.next_in = uncompr;
c_stream.avail_in = (u_int)uncompr_len;
err = deflate(&c_stream, Z_NO_FLUSH);
if (check_error(err, "deflate", c_stream.msg)) return 0;
if (c_stream.avail_in != 0) {
Fprintf(stderr, "deflate not greedy");
}
err = deflate(&c_stream, Z_FINISH);
if (err != Z_STREAM_END) {
Fprintf(stderr, "deflate should report Z_STREAM_END");
}
err = deflateEnd(&c_stream);
if (check_error(err, "deflateEnd", c_stream.msg)) return 0;
/* Fprintf(stdout, "large_deflate(): OK\n"); */
return c_stream.total_out;
}
示例10: mmap_validate_opts
/************************************************************************
* *
* mmap_validate_opts() - Validate Memory Mapped Test Options. *
* *
* Description: *
* This function verifies the options specified for memory mapped *
* file testing are valid. *
* *
* Inputs: dip = The device information pointer. *
* *
* Return Value: *
* Returns SUCESS / FAILURE = Valid / Invalid Options. *
* *
************************************************************************/
int
mmap_validate_opts (struct dinfo *dip)
{
int status = SUCCESS;
/*
* For memory mapped I/O, ensure the user specified a limit, and
* that the block size is a multiple of the page size (a MUST!).
*/
if (mmap_flag) {
if (data_limit == INFINITY) {
Fprintf ("You must specify a data limit for memory mapped I/O.\n");
status = FAILURE;
} else if (block_size % page_size) {
Fprintf (
"Please specify a block size modulo of the page size (%d).\n", page_size);
status = FAILURE;
} else if (aio_flag) {
Fprintf ("Cannot enable async I/O with memory mapped I/O.\n");
status = FAILURE;
} else {
status = validate_opts (dip);
}
}
return (status);
}
示例11: Fprintf
void Nuc3ptStru::PrintTheTag(FILE *fp)
{
G.printTag(fp);
Fprintf(fp,"_") ;
D.printTag(fp) ;
if(strlen(tag)>0) Fprintf(fp,"_%s",tag) ;
}
示例12: WriteHeader
void WriteHeader(FILE * f, char *fname0, char *fname)
{
Fprintf(f, indent, "\nint %s%s(char *fname)\n", fname0, fname);
Fprintf(f, indent, "{\n");
indent++;
WriteDeclaration(f);
}
示例13: flags_set_sync_p2
static void
flags_set_sync_p2( sync_vars_t *svars, sync_rec_t *srec, int t )
{
int nflags, nex;
nflags = (srec->flags | srec->aflags[t]) & ~srec->dflags[t];
if (srec->flags != nflags) {
debug( " pair(%d,%d): updating flags (%u -> %u)\n", srec->uid[M], srec->uid[S], srec->flags, nflags );
srec->flags = nflags;
Fprintf( svars->jfp, "* %d %d %u\n", srec->uid[M], srec->uid[S], nflags );
}
if (t == S) {
nex = (srec->status / S_NEXPIRE) & 1;
if (nex != ((srec->status / S_EXPIRED) & 1)) {
if (nex && (svars->smaxxuid < srec->uid[S]))
svars->smaxxuid = srec->uid[S];
Fprintf( svars->jfp, "/ %d %d\n", srec->uid[M], srec->uid[S] );
debug( " pair(%d,%d): expired %d (commit)\n", srec->uid[M], srec->uid[S], nex );
srec->status = (srec->status & ~S_EXPIRED) | (nex * S_EXPIRED);
} else if (nex != ((srec->status / S_EXPIRE) & 1)) {
Fprintf( svars->jfp, "\\ %d %d\n", srec->uid[M], srec->uid[S] );
debug( " pair(%d,%d): expire %d (cancel)\n", srec->uid[M], srec->uid[S], nex );
srec->status = (srec->status & ~S_EXPIRE) | (nex * S_EXPIRE);
}
}
}
示例14: check_error
int check_error(int err, char *prompt, char *msg) {
if (err != Z_OK) {
Fprintf(stderr, "%s error: %d", prompt, err);
if (msg) Fprintf(stderr, "(%s)", msg);
Fprintf(stderr, "\n");
return 1;
}
return 0;
}
示例15: FSelectTest
int FSelectTest(char InputFile[MAX_LINE][MAX_CHAR_LINE],int user,Planning *pt_plan,
Pricing *pt_pricing, Option *opt,Model *mod,PricingMethod *met,DynamicTest **test)
{
int i,ii,isub,k,j;
DynamicTest** list;
DynamicTest* dummy;
char line[MAX_CHAR_LINE];
if (pt_plan->Action=='t')
{
Fprintf(TOSCREEN,"\n_______________________TEST CHOICE:\n\n");
list=pt_pricing->Test;
i=0;isub=0;
dummy=*list;
while ( dummy !=NULL)
{
if( (dummy->CheckTest)(opt,mod,met) == OK)
{
for(ii=0;ii<MAX_LINE;ii++){
j=0;
while(j<=(signed)(strlen(InputFile[ii])-strlen((pt_pricing->Test[i])->Name)))
{
if( (j==0 || (j>0 && InputFile[i][j-1]==' ')) &&
( InputFile[i][j+strlen((pt_pricing->Test[i])->Name)] == ' ' ||
InputFile[i][j+strlen((pt_pricing->Test[i])->Name)] == '\0')
){
for(k=j;k<j+(signed)strlen((pt_pricing->Test[i])->Name);k++)
line[k-j] = InputFile[ii][k];
line[j+(signed)strlen((pt_pricing->Test[i])->Name)]='\0';
if (StrCasecmp((pt_pricing->Test[i])->Name,line) == 0){
*test=pt_pricing->Test[i];
(*test)->Init(*test, opt);
goto ok;
}
}
j++;
}
}
isub++;
}
i=i+1;
list++;dummy=*list;
}
if (isub==0)
{
Fprintf(TOSCREEN,"No test available!\n");
}
else
{
Fprintf(TOSCREEN,"No tests found, exiting....\n");
}
}
ok:
return OK;
}