Re: problem with malloc/realloc. Pls help.

2006-08-22 Thread Omololu
Thanks a lot, Igor Mark. i was able to rectify the code to fix the problem. Now it works. (i had to use a pointer to a pointer to int, rather than just a pointer to int in the subroutine) thanks again. o. --- Igor Peshansky [EMAIL PROTECTED] wrote: On Mon, 21 Aug 2006, Omololu wrote:

problem with malloc/realloc. Pls help.

2006-08-21 Thread Omololu
Hi, i have the following code. it compiles with gcc in Cygwin but the contents of the array ifitQ that I get after the call to the subroutine readCharges2 is gibberish. The code compiles with gcc under Linux and it runs correctly. it also compiles and runs correctly with windows visual studio.

Re: problem with malloc/realloc. Pls help.

2006-08-21 Thread Igor Peshansky
On Mon, 21 Aug 2006, Omololu wrote: Hi, i have the following code. it compiles with gcc in Cygwin but the contents of the array ifitQ that I get after the call to the subroutine readCharges2 is gibberish. This is expected behavior. Read on. The code compiles with gcc under Linux and it

Re: problem with malloc/realloc. Pls help.

2006-08-21 Thread Igor Peshansky
On Mon, 21 Aug 2006, Igor Peshansky wrote: On Mon, 21 Aug 2006, Omololu wrote: Hi, i have the following code. it compiles with gcc in Cygwin but the contents of the array ifitQ that I get after the call to the subroutine readCharges2 is gibberish. This is expected behavior. Read on.

Re: problem with malloc/realloc. Pls help.

2006-08-21 Thread Mark Fisher
On 8/21/06, Omololu wrote: Hi, i have the following code. it compiles with gcc in Cygwin but the contents of the array ifitQ that I get after the call to the subroutine readCharges2 is gibberish. looks like a passing by reference problem. if you add debug to look at the address of ifitQ at