[DUVIDA]no sscanf
#4

Antes de uma lida:
Quote:
Originally Posted by ******
Посмотреть сообщение
Код:
Specifier(s)			Name				Example values
	i, d			Integer				1, 42, -10
	c			Character			a, o, *
	l			Logical				true, false
	b			Binary				01001, 0b1100
	h, x			Hex				1A, 0x23
	o			Octal				045 12
	n			Number				42, 0b010, 0xAC, 045
	f			Float				0.7, -99.5
	g			IEEE Float			0.7, -99.5, INFINITY, -INFINITY, NAN, NAN_E
	u			User name/id (bots and players)	******, 0
	q			Bot name/id			ShopBot, 27
	r			Player name/id			******, 42
Vamos la,
pawn Код:
if(sscanf(cmdtext, "s[6]s[64]", cmd, cfg))//1
if(sscanf(cmdtext, "s[6]us[64]", cmd, plid, motivo))//2
1:

s[6] - s 'string' [6] 'tamanho'
s[64] - s 'string' [6] 'tamanho'

2:
s[6] - s 'string' [6] 'tamanho'
u - Id de jogador
s[64] - s 'string' [6] 'tamanho'

Basicamente й isso.

referente ao outro:
pawn Код:
"s[7]p<,>fffd"
s[7] - s string, [7] 'tamanho'
p<,> - se nгo me engano й para tirar algo da string ou pegar ela sem aquele caracter no caso uma ','
f - float
d - inteiro
Reply


Messages In This Thread
[DUVIDA]no sscanf - by VenoN - 15.11.2012, 17:59
Re: [DUVIDA]no sscanf - by DrTHE - 15.11.2012, 18:01
Re: [DUVIDA]no sscanf - by VenoN - 15.11.2012, 18:13
Re: [DUVIDA]no sscanf - by DrTHE - 15.11.2012, 18:26
Re: [DUVIDA]no sscanf - by VenoN - 15.11.2012, 18:55

Forum Jump:


Users browsing this thread: 1 Guest(s)