By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,919 Members | 1,600 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,919 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...
Feb 10 '18 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 5K+
P: 9,197
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);
so your code fix is:

Expand|Select|Wrap|Line Numbers
  1. fflush(barcode_ffd);
Feb 10 '18 #2

Post your reply

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