[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

How to use st_table by oneself?

gz zz

10/5/2008 4:04:00 AM

http://www.ruby-doc.org/doxygen/1.8.4/...
Is there some tutorials or examples about it?thanks
--
Posted via http://www.ruby-....

2 Answers

Joel VanderWerf

10/5/2008 7:23:00 PM

0

gz zz wrote:
> http://www.ruby-doc.org/doxygen/1.8.4/...
> Is there some tutorials or examples about it?thanks

hash.c in the ruby source might help. Also, the Ruby Hacking Guide has
some info:

http://rhg.rubyforge.org/chap...

--
vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407

gz zz

10/6/2008 1:23:00 AM

0

Joel VanderWerf wrote:
> gz zz wrote:
>> http://www.ruby-doc.org/doxygen/1.8.4/...
>> Is there some tutorials or examples about it?thanks
>
> hash.c in the ruby source might help. Also, the Ruby Hacking Guide has
> some info:
>
> http://rhg.rubyforge.org/chap...
oh,thank you!
My "hello world" with st_table:

#include <stdio.h>
#include <stdlib.h>
#include "st.c"
int main(int argc, char *argv[])
{
st_table *tbl=st_init_numtable();

st_insert(tbl,1,100);
char *hello = "hello world";
st_insert(tbl,2,(st_data_t)hello);
st_data_t ret;
if(st_lookup(tbl,1,&ret)){
printf("%d\n",ret);
}

if(st_lookup(tbl,2,&ret)){
printf("%s\n",ret);
}

st_free_table(tbl);
system("PAUSE");
return 0;
}
--
Posted via http://www.ruby-....