Thanks, :)

But now I think that's ok to use the int type to store the four byte.
Because I could get the value by using forced conversion.

But Do SQLite3 support the unsigned type?

And You know that int64 is too wasting here.



Pavel Ivanov-2 wrote:
> 
> int64 type is okay to store data of type unsigned int. And int64 is
> exactly the type used for all integers in SQLite.
> 
> Pavel
> 
> On Fri, Aug 7, 2009 at 5:53 AM, liubin liu<7101...@sina.com> wrote:
>>
>> I want to use a integer to save the ip address of ipv4. Because they all
>> are
>> 4 bytes.
>>
>> but it is better when the data type is unsigned int.
>>
>> How to create a data of unsigned int?
>> 1334
>> 1335     // tcp->gate_addr[0]是地址的高8位
>> 1336     for ( i=0, m=1; i<4; i++, m*=0x100 )
>> 1337         gateaddr = gateaddr + tcp->gate_addr[3-i] * m;
>> 1338
>>
>> --
>> View this message in context:
>> http://www.nabble.com/How-to-create-a-data-of-unsigned-int--tp24861945p24861945.html
>> Sent from the SQLite mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> 
> 

-- 
View this message in context: 
http://www.nabble.com/How-to-create-a-data-of-unsigned-int--tp24861945p24864619.html
Sent from the SQLite mailing list archive at Nabble.com.

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to