This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Dynamic malloc problem
- To: help-gcc at gnu dot org
- Subject: Re: Dynamic malloc problem
- From: "clifford.smith" <clifford dot smith at libertysurf dot fr>
- Date: Sun, 2 Jan 2000 20:21:38 +1200
- Newsgroups: gnu.gcc.help
- References: <84lf9k$i7i$1@news4.isdnet.net> <84mrvu02k3p@enews2.newsguy.com>
- Xref: wodc7nx0 gnu.gcc.help:2331
Thanks for your help, I am pretty sure that there is no bugs, but let me
check ...
Serge
Johnny Favorite (it means "Writhing Tentacle of Death") a écrit dans le
message <84mrvu02k3p@enews2.newsguy.com>...
>clifford.smith wrote:
>> sine I allocate memory with malloc for table in the main() it
>> works perfectcly. As soon as I try to allocate this memory in
>> a function (void my_funct() ... ) I get a segm. fault.
>>
>> What can I do. Is there another way to dynamicaly allocate mem ?
>
>The fault is in your code. There is absolutely no reason why you shouldn't
>be able to malloc() in a function other than main(). Look for bugs.
>
>