< politely>由于这一点,并且没有API工具来遍历 行或向下列,你动态分配的关联 数组提供的哈希表不会是什么提供? - 克里斯。 Thanks for posting this (but, be prepared for others shouting "send itto comp.programming"). <politely> As this stands, and without API facility to iterate across arow, or down a column, what does your dynamically allocated associativearray provide that a hashtable wouldn''t provide? --Chris. 6月10日星期六2006 01:33:49 +0000,Richard Heathfield写道:On Sat, 10 Jun 2006 01:33:49 +0000, Richard Heathfield wrote: tabl = malloc(sizeof(tabl-> number_of_elements)+ sizeof(tabl-> column1) + sizeof(tabl-> column2)); tabl-> column1 = malloc(sizeof(tabl-> column1)); 钟声!钟声! tabl = malloc(sizeof(tabl->number_of_elements) + sizeof(tabl->column1) + sizeof(tabl->column2)); tabl->column1 = malloc(sizeof(tabl->column1)); The bells! The bells! 我其实不是那个C大师,但我希望这是正确的(虽然丑陋 看)。你能告诉我这个代码有什么危险吗?或许你想给我讲一些讲座吗? 2006年6月10日星期六01:42:42 +0000 ,克里斯麦克唐纳写道:感谢发布这个(但是,准备好让其他人大喊发送它到comp.programming) 新用户网帖,对不起。 < politely>由于这一点,并且没有API工具来遍历行或向​​下列,您的动态分配的关联数组提供的哈希表无法提供什么? I''m actually not that C guru, but I expect this to be correct (though uglylooking). Could you tell me whats dangerous about this code or perhapspoint me to some lecture? On Sat, 10 Jun 2006 01:42:42 +0000, Chris McDonald wrote: Thanks for posting this (but, be prepared for others shouting "send it to comp.programming)New to Usenet posting, sorry for that. <politely> As this stands, and without API facility to iterate across a row, or down a column, what does your dynamically allocated associative array provide that a hashtable wouldn''t provide? *经过一番调查* 几乎没有。 所以我想知道为什么人们一直在问这个问题,我什么也没想到比如 这个存在于C中而且从不需要它。 反正我的好习惯。 - /〜\ ascii ribbon campaign for html email \ /和专有附件! X /永远不会将.doc .xls或.ppt文件附加到电子邮件中! *after some investigation*Approximately nothing.So I''m wondering why people keep asking about this, I assumed nothing likethis to exist in C and never needed it myself. Good practice for me anyways.--/~\ the ascii ribbon campaign against html email\ / and proprietary attachments!X/ \ never attach .doc .xls or .ppt files to emails! 这篇关于C中动态分配的关联数组的示例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-27 16:13