warning: passing argument 1 of âtcflushâ makes integer from pointer without a cast [e

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nomad2003
    New Member
    • Feb 2018
    • 1

    warning: passing argument 1 of âtcflushâ makes integer from pointer without a cast [e

    FILE *err_fp, *barcode_ffd;
    C++ code 64 bit LINUX.
    .
    .
    barcode_ffd = fopen(barcode_p rinter,"w");
    .
    .
    tcflush(barcode _ffd,TCIOFLUSH) ; /* clear out buffers for printer */

    THE TCFLUSH gives me the error, what code is needed to fix this...
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    barcode_ffd is a FILE*.

    the tcflush argument is an int and the return is also an int.

    The compiler is telling you that a FILE* is not an int.

    I suspect that tcflush is not the function you want. Instead you may want the flush for a FILE*. That function is:
    Code:
    int fflush(FILE *stream);
    so your code fix is:

    Code:
    fflush(barcode_ffd);

    Comment

    Working...