Optional specifiers - SSCANF
#1

Hi.

Код:
sscanf(params,"I(100)",health);
"I (uppercase)" represents an optional specifier value of 100 by default.

Код:
input = "1 2";
 sscanf(input, "A<i>(3)[4]", arr);

//<i>?
What does this code?, What is <i>?
Reply
#2

integer same as

new value;
sscanf(params,"i",value);
Reply
#3

Quote:
Originally Posted by Jefff
Посмотреть сообщение
integer same as

new value;
sscanf(params,"i",value);
No, altogether it is:
A<i> 'array of integers'
(3) 'default of 3'
[4] '4 values'

This [sscanf("1 2", "A<i>(3)[4]", arr);] would produce and array of integers 1, 2, 3, and 3.
Reply
#4

Quote:
Originally Posted by Crayder
Посмотреть сообщение
No, altogether it is:
A<i> 'array of integers'
(3) 'default of 3'
[4] '4 values'

This [sscanf("1 2", "A<i>(3)[4]", arr);] would produce and array of integers 1, 2, 3, and 3.
Got it thanks.

Out of curiosity, Can you give another example code concerning that ?. Please.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)