|
-
May 28th, 2010, 08:29 AM
#1
how to read an octal number?
Hello,
Given an 8 bit octal value sent over a tcp/ip connection how can I read it and display the value?
Regards,
E. Khule
-
May 28th, 2010, 08:52 AM
#2
Re: how to read an octal number?
Read it into an unsigned char, then cast it to an unsigned int for output.
More computing sins are committed in the name of efficiency (without necessarily achieving it) than for any other single reason - including blind stupidity. --W.A.Wulf
Premature optimization is the root of all evil --Donald E. Knuth
Please read Information on posting before posting, especially the info on using [code] tags.
-
May 28th, 2010, 09:04 AM
#3
Re: how to read an octal number?
Is it being sent as a text representation of octal value? Try strtol() (or related functions) that take a radix argument.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|