422,023 Members | 987 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 422,023 IT Pros & Developers. It's quick & easy.

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

P: 1
FILE *err_fp, *barcode_ffd;
C++ code 64 bit LINUX.
.
.
barcode_ffd = fopen(barcode_printer,"w");
.
.
tcflush(barcode_ffd,TCIOFLUSH); /* clear out buffers for printer */

THE TCFLUSH gives me the error, what code is needed to fix this...
2 Weeks Ago #1
Share this Question
Share on Google+
1 Reply


weaknessforcats
Expert Mod 5K+
P: 9,089
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:
Expand|Select|Wrap|Line Numbers
  1. int fflush(FILE *stream);
  2.  
so your code fix is:

Expand|Select|Wrap|Line Numbers
  1. fflush(barcode_ffd);
2 Weeks Ago #2

Post your reply

Sign in to post your reply or Sign up for a free account.