Date: Wed, 15 Sep 1999 12:02:18 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Batchex cc: djgpp AT delorie DOT com Subject: Re: invalid operands In-Reply-To: <1684.990913@Phreaker.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Mon, 13 Sep 1999, Batchex wrote: > char **lpszTable; [snip] > for(nIdx=1;nIdx lpszTable[nIdx]=(char *)(lpszTable[0]+(lpszTable[nIdx]-lnDataStart)); [snip] > > The last line of the code always gives me "invalid operands for > binary +". lpszTable is a pointer to a pointer. Therefore, lpszTable[0] and (lpszTable[nIdx]-lnDataStart) are both pointers. You cannot add two pointers in C. That's what the compiler keeps telling you. > One other question, not related to the above code, anybody know any > function that can read raw data from file (like _dos_read()) that is > POSIX compliant? fread() seems to stop whenever it encounter CR/LF > pair ("\n"), and my data have a lot of them. Use the "b" specifier when you open the file, like this: FILE *fp - fopen ("filename", "rb"); And no, _dos_read is not Posix. The DJGPP library docs explicitly tell which functions are ANSI- and Posix-compliant and which aren't. Please use that information, it is there for you.