misc.c:3210: invalid operands to binary + [Archive] - C Board

PDA

View Full Version : misc.c:3210: invalid operands to binary +


Unregistered
07-18-2002, 10:02 PM
Well.... This error is occuring under my linux box, and if anyone has ever tried to compile SWRIP code, they know what I'm talking about...


/* Delete the $~ from the end of the file */
fgetpos(fp, &pos);

pos += -2; /*This is where there error is! Line 3210 */
fsetpos(fp, &pos);
fprintf(fp, "%s~\n",name);
fprintf(fp, "$~");
fclose(fp);
return 1;


Again, the error is "invalid operands to binary +"

So what do I do?!?!

If need be I'll post the file here for you to look at.

"pos" is an instance of "fpos_t"... "fpos_t" must be in the one of the includer files, because it's not defined anywhere in this code I have...

quagsire
07-18-2002, 11:11 PM
pos += -2; // ????

try
pos -= 2;

Salem
07-19-2002, 07:00 AM
You've assumed fpos_t is an integral type, and in your implementation it isn't

It should be in stdio.h (I think)

Perhaps fseek would be better