-
Help with error
Hi everyone,
I'm trying to compile this program on my mac and I get this error:
Naix:examples Naix$ g++ -o prodcon prodcon.c
prodcon.c:129:32: error: empty character constant
prodcon.c: In function ‘void* producer(void*)’:
This are the code snippets:
129: while ( context->holder != '' ) {
nvm by replacing those with ""
-
Code:
while ( context->holder != '' )
has two single quotes in sequence. You need to have something between them to represent a single character. The compiler is telling you off for leaving out whatever is needed between them (i.e. you need to have something between the quote characters, but you haven't. You have left it empty).
For example 'A' represents uppercase A. '\'' (no double quotes here!) is a character that is a single quote.