Hi Hammer,
Does this mean that C will not always throw a seg fault for memory accessed illegally from the heap?
-Addie
Type: Posts; User: addie
Hi Hammer,
Does this mean that C will not always throw a seg fault for memory accessed illegally from the heap?
-Addie
I would write the function loop more like this:
for(i=startnum;i<startnum+numrow*incr;i+=incr)
printf("%1f \t %1f \t %1f\n",i,i*i,i*i*i);
y'know, you are right. In order to test this, I removed all the functions making it one big chunk of code. Without function calls and with the (short *) instead of the (short), the program ran fine!...
Thanks everybody.
Dave, the code snippet that you gave me was pretty much what I was attempting, only part of a much bigger program. I was of the opinion that the seg fault was because malloc'd...
Thanks!
Hi,
I pass a pointer to a function, and then I malloc some memory to that pointer (inside that function). I then need to return this memory to the calling function. Because the malloc'd stuff goes...