printf conversion specifiers Flashcards

1
Q

%

A

display a % character (no arg is required)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

b

A

display arg as a binary integer

1111011

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

c

A

display ascii character for the arg

{

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

d

A

display arg as a signed decimal integer

123

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

e

A

display arg using scientific notation

1.23000e+2

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

f

A

display arg as floating point

123.000000

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

o

A

display arg as an octal integer

173

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

s

A

display arg as a string

123

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

u

A

display arg as an unsigned decimal

123

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

x

A

display arg as a lowercase hexadecimal

7b

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

X

A

display arg in uppercase hexadecimal

7B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

sprintf

A

send the output to another variable rather than to the browser. useful for making conversions. for example:

$hexstring = sprintf(“%X%X%X”, 65, 127, 245);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly