Re: why it is not work?



"yezi" <ye_line@xxxxxxxxxxx> writes:

>Hi: all:

>The code is like :

>char *data;

>data = malloc(1000);
>if (data = NULL)

here ^^^

> {
> printf (" can not assign the memory for the packet\n");
> exit(1);
> }

> memset(data,'\0',1000);


>The code is failure say "Segmentation fault"
>The problem is memset, why?


--
Chris.
.



Relevant Pages

  • Identity crisis
    ... But, when I switch to the other identity, I show zero names in that contact ... although I am sharing an ... Chris ... Prev by Date: ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • RE: file reading problem
    ... Chris ... Prev by Date: ...
    (comp.lang.fortran)
  • Re: 2nd and 4th Wednesdays formula?
    ... The first formula I used (at cell E1) is: ... Substituting other values from 1 to 7 would give the other days of the ... Chris ... Prev by Date: ...
    (microsoft.public.excel.worksheet.functions)
  • Re: EtherNEC instructions/website?
    ... > faster transfer rate than the serial port. ... Chris ... Prev by Date: ...
    (comp.sys.atari.st)
  • Re: OT: Aerial review
    ... > I will get round to sending you DVDs for the other stuff. ... Chris ... Prev by Date: ...
    (uk.comp.sys.mac)