Hi! I’m clsung

Hi! I’m clsung

clsung’s blog site, or you can call me AlanSung

Hi! I’m clsung RSS Feed
 
 
 
 

realloc/calloc

切記切記,兩個的 parameter 不太一樣,我老是忘記,然後就 Segmenation fault :roll:

word_freq = (char*)calloc(i , sizeof(char));
word_freq = (char*)realloc(word_freq,i * sizeof (char));
Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • funp
  • Haohao
  • Hemidemi
  • Live
  • MisterWong
  • TwitThis
  • udn

Leave a Reply

噗浪:

分類

Flickr

    clsung. Get yours at bighugelabs.com/flickr

Blogroll

    馬的警總回來了
Creative Commons Attribution-NonCommercial-ShareAlike 2.5 Taiwan
Creative Commons Attribution-NonCommercial-ShareAlike 2.5 Taiwan