Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: printf x format ?

by ikegami (Patriarch)
on Mar 03, 2022 at 07:19 UTC ( [id://11141773]=note: print w/replies, xml ) Need Help??


in reply to printf x format ?

'A' produces a string. The same string as "A".

The formats largely control how numbers are converted to strings for printing. Strings are already strings, so only one format is needed for them (%s).

%c applies chr to a number, %x produces a hex representation of a number, and %d produces a decimal representation of a number.

You probably wanted to pass ord('A') aka 0x41 aka 65.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11141773]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2024-04-25 04:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found