The meaning of the c in calloc
The meaning of the c in calloc was vividly discussed in comp.lang.c in October 2000 (see here), with both clear (because, unlike malloc, calloc clears the memory it returns) and count (because, unlike malloc, calloc is passed a count of elements to allocate) suggested as possible explanations, however without real evidence for either. Other suggestions were (along with several less serious ones) contiguous, core, commit, chunk, and character, the latter because in early versions of K&R C, calloc was the only allocation function in the library (and had an accompanying cfree). For the same reason, it was even suggested that the c simply stand for the C programming language. So, the etymology of calloc still isn't proven, and if anybody has any definite evidence as to its meaning, I'd highly appreciate learning about it.
Ïà¹ØÎĵµ£º
Ç°ÌìÍíÉÏÓöµ½Ò»Ì⣬±àд³ÌÐòÇó³ö×î´ó¹«ÒòÊý£¨×î´ó¹«Ô¼Êý£©£¬±¾ÄܵÄÎÒÏëÆðÀ´ÁËÊýѧÖÐÇó×î´ó¹«ÒòʽµÄ·½·¨£¬¿ÉÊÇÔÚ³ÌÐòʵ¼ùÉÏ
Ã÷ÏԵijöÁËÎÊÌ⣬Á½¸öÊýÒªÒ»¸öÒ»¸öµÄ½øÐвð½â£¬È»ºóÕÒµ½ÏàͬµÄ£¬Õâ¸ù±¾ÊÇÒ»ÌõËÀ·£¬Ë¼Ë÷Ò»Ò¹ÐÑÀ´£¬Í»È»±Å·¢Áé¸Ð£¬¿ÉÒÔ
ÓÃÁ½¸öÊý½øÐÐÈ¡ÓàÔËË㣬Èç¹ûÓàÊýΪÁãÔò×î´ó¹«ÒòÊýΪ±»³ýÊý£¬²»ÎªÁãÔòÓàÊýΪ×î ......
1¡¢Òþʽת»»
CÔÚÒÔÏÂËÄÖÖÇé¿öÏ»á½øÐÐÒþʽת»»:
1¡¢ËãÊõÔËËãʽÖУ¬µÍÀàÐÍÄܹ»×ª»»Îª¸ßÀàÐÍ¡£
2¡¢¸³Öµ±í´ïʽÖУ¬Óұ߱í´ïʽµÄÖµ×Ô¶¯Òþʽת»»Îª×ó±ß±äÁ¿µÄÀàÐÍ£¬²¢¸³Öµ¸øËû¡£
3¡¢º¯ ......
@echo --------------------- ÓÃÓÚ¡¶Ò»¸ö²Ù×÷ϵͳµÄʵÏÖ¡·µÄ cmd ---------------------
@echo off
mode con cols=80 lines=60 ::Ç°Ò»¸öÊý×Ö»ò×ÖĸΪ±³¾°É«£¬ºóÒ»¸öÊý×Ö»òÕß×ÖĸΪǰ¾°É«£¬ÏÂÃæÊÇһЩÑÕÉ«¶ÔÓ¦µÄÊý×Ö»ò×Öĸ£º
::0£½ºÚ¡¢1£½À¶¡¢2£½ÂÌ¡¢3£½Ç³ÂÌ¡¢4£½ºì¡¢5£½×Ï¡¢6£½»Æ¡¢7=°×¡¢8=»Ò¡¢9=µÀ¶¡¢A£½µ ......
1¡¢×÷ÓÃ
ΪÁËÔÚʵÏÖ¶à̬µÄʱºò²»Ôì³ÉÄÚ´æй¶,
Èç¹û»ùÀàÎö¹¹º¯ÊýÇ°²»¼Óvitual£¬ÅÉÉúÀà¶ÔÏó±»Ïú»Ùºó£¬Ö»»áµ÷ÓûùÀàµÄÎö¹¹º¯Êý£¬¶ø²»»áÈ¥µ÷ÓÃÅÉÉúÀàµÄÎö¹¹º¯Êý¡£
2¡¢¶ÔÓÚÕý³£µÄº¯Êý£¬Èç¹û»ùÀàÖÐÉùÃ÷Ϊvirtual£¬ÔòÅÉÉúÀà¿ÉÒÔ²»ÓÃÔÙдvirtual
// CPPTest.cpp : Defines the entry point for the console application.
// ......
»Ø¹Ë֮ǰµÄƪ·ù£¬CÓïÑÔµÄÖ÷Ì岿·Ö»ù±¾ÒѾ½éÉÜÍêÁË¡£Ö®ËùÒÔûÓнéÉÜC++µÄÏà¹ØÌØÐÔÊÇÒòΪÔÚ֮ǰµÄÎÄÕÂÖÐCºÍC++ÔÚÕâЩ·½Ã涼Óй²ÐÔ£¬ËùÒÔÔÚÃæÏò¶ÔÏó֮ǰ¡£ÎÒÃÇÏÈ°ÑÕâЩ¹²ÐÔ¸ø½éÉÜÍê¡£Ò²¾ÍÊÇ˵ÔÚ½éÉÜÃæÏò¶ÔÏó֮ǰ£¬ËùÓеÄÎÄÕ¶¼ÊÇCC++Öж¼ÄÜʹÓõġ£´ÓÕâµãÉÏÀ´¿´£¬ÏÖÔÚÕý¼«Á¦·Ü¶·ÓÚC++Õ½ÏßÉϵijõѧÕß»¹ÊǺÜÓÐÓô¦µÄ¡£
±¾Æª¼ÌÐ ......