[Include] beta ibits
#24

Quote:
Originally Posted by Juniiro3
View Post
Boa Willian (y) (Jб dei muita rep nas ultimas 24h :/)

char = character em quase todas as linguagens, e no Pawn significa 8 bits? o.O
Char nas demais linguagem й um objeto e tambйm um tipo primitivo de variбvel.

No Pawn й utilizado para compactar valores.

Como foi explicado no tуpico, vocк tem um valor comum que lhe rende 32 bits(espaзos, por exemplo):
pawn Code:
00000000000000000000000000000000 //32 bits
Quando vocк cria vetores como [MAX_PLAYERS], sгo 500 valores que rendem 32 bits para cada um desses valores.

Com essa include vocк consegue controlar melhor isto, e alйm disto, utilizando char tambйm(sу que somente para valores 0-255).

Ficando mais ou menos assim:
Code:
00000000 00000000 00000000 00000000 // 32 bits
Vocк pode notar que eu separei os 32 bits em casinhas de 8 bits, й isso que o pack(char) faz.
Assim vocк consegue utilizar valores com um tamanho menor de memуria ocupada, visando que vocк nгo utilizaria um nъmero de 32 bits...

Logo se vocк usa MAX_PLAYERS em char, ao invйs de um vetor de 500, vocк teria 500 / 4 = 125, oque й uma reduзгo muito, muito grande.
Reply


Messages In This Thread
beta ibits - by WLSF - 13.10.2013, 08:57
Re : beta ibits - by ipsBruno - 13.10.2013, 08:59
Re: beta ibits - by PT - 13.10.2013, 11:51
Re: beta ibits - by RebeloX - 13.10.2013, 12:24
Re: beta ibits - by Falcon. - 13.10.2013, 13:25
Re: beta ibits - by WLSF - 13.10.2013, 13:33
Re: beta ibits - by Falcon. - 13.10.2013, 13:45
Re: beta ibits - by WLSF - 13.10.2013, 13:54
Re: beta ibits - by P1c4550 - 13.10.2013, 14:01
Re: beta ibits - by shittt - 13.10.2013, 14:24
Re: beta ibits - by zPain - 13.10.2013, 15:51
Re: beta ibits - by WLSF - 13.10.2013, 15:56
Re: beta ibits - by zPain - 13.10.2013, 16:05
Re: beta ibits - by Falcon. - 13.10.2013, 16:28
Re: beta ibits - by Schocc - 13.10.2013, 18:44
Re: beta ibits - by Dolby - 13.10.2013, 18:50
Re: beta ibits - by zSuYaNw - 13.10.2013, 19:32
Re: beta ibits - by WLSF - 13.10.2013, 19:52
Re: beta ibits - by Falcon. - 13.10.2013, 21:11
Re: beta ibits - by WLSF - 13.10.2013, 22:10
Re : beta ibits - by ipsBruno - 13.10.2013, 23:09
Re: beta ibits - by WLSF - 15.10.2013, 00:33
Re: beta ibits - by Juniiro3 - 15.10.2013, 00:35
Re: beta ibits - by WLSF - 15.10.2013, 00:46
Re: beta ibits - by Juniiro3 - 15.10.2013, 01:02
Re: beta ibits - by Dolby - 15.10.2013, 01:03
Re: beta ibits - by WLSF - 15.10.2013, 01:04
Re: beta ibits - by shittt - 15.10.2013, 01:17
Re: beta ibits - by WLSF - 15.10.2013, 01:22
Re: beta ibits - by shittt - 15.10.2013, 01:52
Re: beta ibits - by XxFaTaLxX - 15.10.2013, 12:03
Re: beta ibits - by WLSF - 15.10.2013, 20:11
Re: beta ibits - by PT - 15.10.2013, 20:22
Re: beta ibits - by shittt - 15.10.2013, 20:23
Re: beta ibits - by WLSF - 04.11.2013, 04:32
Re: beta ibits - by smiiir - 04.11.2013, 08:07
Re: beta ibits - by WLSF - 04.11.2013, 13:27
Re: beta ibits - by smiiir - 04.11.2013, 13:32
Respuesta: beta ibits - by DanDRT - 04.11.2013, 13:46

Forum Jump:


Users browsing this thread: 1 Guest(s)