Find the answer to your Linux question:
Results 1 to 9 of 9
Hello, I have this code: BioAPI_FAR FARRequest=0; BioAPI_BOOL bFARPrecedence=0; BioAPI_INPUT_BIR inputProcessed; BioAPI_FAR FARAchieved; inputProcessed.Form = BioAPI_BIR_HANDLE_INPUT; inputProcessed.InputBIR.BIRinBSP = &hProcessdBIR; bioReturn = BioAPI_VerifyMatch(g_ModuleHandle, &FARRequest, NULL, &bFARPrecedence, &inputProcessed, &g_inputStoredBir, NULL, &bResult, &FARAchieved ...
  1. #1
    Just Joined!
    Join Date
    Mar 2008
    Posts
    12

    Print a value to a file?

    Hello,

    I have this code:

    BioAPI_FAR FARRequest=0;
    BioAPI_BOOL bFARPrecedence=0;
    BioAPI_INPUT_BIR inputProcessed;
    BioAPI_FAR FARAchieved;
    inputProcessed.Form = BioAPI_BIR_HANDLE_INPUT;
    inputProcessed.InputBIR.BIRinBSP = &hProcessdBIR;

    bioReturn = BioAPI_VerifyMatch(g_ModuleHandle,
    &FARRequest,
    NULL,
    &bFARPrecedence,
    &inputProcessed,
    &g_inputStoredBir,
    NULL,
    &bResult,
    &FARAchieved,
    NULL,
    NULL);
    How can I print &FARAchieved to a file?
    Or, printing the whole bioReturn would be fine too.

    Thanks a lot!

  2. #2
    Linux Engineer GNU-Fan's Avatar
    Join Date
    Mar 2008
    Posts
    935
    with fprintf
    Debian GNU/Linux -- You know you want it.

  3. #3
    Just Joined!
    Join Date
    Mar 2008
    Posts
    12
    Quote Originally Posted by GNU-Fan View Post
    with fprintf
    Could you please be more specific?

  4. #4
    Linux Engineer GNU-Fan's Avatar
    Join Date
    Mar 2008
    Posts
    935
    Well, specifics would depend on what BioAPI_FAR precisely is.
    Provided you are interested not in the address of the variable but in the value it has.
    Debian GNU/Linux -- You know you want it.

  5. #5
    Just Joined!
    Join Date
    Mar 2008
    Posts
    12
    Quote Originally Posted by GNU-Fan View Post
    Well, specifics would depend on what BioAPI_FAR precisely is.
    Provided you are interested not in the address of the variable but in the value it has.
    Yes, I need the value.

    This is what programmers documentation says:

    BioAPI_FAR
    A 32-bit integer value (N) that indicates a probable False Accept Rate of N/(231-1). The larger the value, the
    worse the result.
    typedef sint32 BioAPI_FAR, *BioAPI_FAR_PTR;
    #define BioAPI_NOT_SET (-1)

    NOTE: FAR is used within BioAPI as a means of setting thresholds and returning scores.
    NOTE: The IRISPASS-M BioAPI Software Development Kit always sets 1790 to the value N. This means that FAR is 1 in 1.2 million. (The actual FAR varies for each verification or identification.
    Any help would be really appreciated!

    Thanks a lot.

  6. #6
    Linux Engineer GNU-Fan's Avatar
    Join Date
    Mar 2008
    Posts
    935
    Ok, so FARAchieved is a 32 bit signed integer, and &FARAchieved is a pointer of/to it.
    This corresponds to the "%d" code in the fprintf and printf format.
    printf [C++ Reference]

    But for fprintf, you will also need a file handle of an open file.
    fprintf [C++ Reference]
    Debian GNU/Linux -- You know you want it.

  7. #7
    Just Joined!
    Join Date
    Mar 2008
    Posts
    12
    Thanks.

    I tried this:

    int myFAR = *FARAchieved;
    FILE *out = fopen( "output.txt", "w" );
    if( out != NULL )
    fprintf( out, "%d\n", myFAR );
    And I get "error C2100: illegal indirection" error

  8. #8
    Linux Engineer GNU-Fan's Avatar
    Join Date
    Mar 2008
    Posts
    935
    Because FARAchieved is not a pointer.
    Debian GNU/Linux -- You know you want it.

  9. #9
    Just Joined!
    Join Date
    Mar 2008
    Posts
    12
    Quote Originally Posted by GNU-Fan View Post
    Because FARAchieved is not a pointer.
    So how would I print it correctly?
    Would this also automatically create the file?

    Sorry, for such questions, I am new to programming.

    Thanks a lot for your replies so far!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...