Re: printf
- From: Shane <shane@xxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 31 Jul 2007 18:28:51 +1200
Ian Collins wrote:
Shane wrote:
Barry Schwarz wrote:That isn't a lot of help, is the data textual (does it look like the
On Tue, 31 Jul 2007 14:33:29 +1200, Shane <shane@xxxxxxxxxxxxxxxxxxxx>
wrote:
Hi all, I am learning C, and I have a problem with printf.What is the exact type of the pointer?
I have a pointer that points to binary data, and I want to print that
data
out. If I cast the pointer to (char *) then the data is printed out in
the UniCode(?) equivalent of the data.
If I try to cast to (int *) then I only get the address of the pointer
(I
think). What I really want is all the ones and zeros to be printed
out.
Void
"Binary data" is term that has
had several different meanings in various posts. What does the
pointer really point to?
Binary data, 1's and 0's
I can interpret the data, if I can read it.
Give a short example if possible.
1111 1010 1100 1110
above in an editor), or raw data?
If it is the former, you can probably just cast to char* and print it,
otherwise you have to know the exact format of the data in oder to
convert it into something meaningful.
Hi
from my OP
" If I cast the pointer to (char *) then the data is printed out in
the UniCode(?) equivalent of the data."
Which isnt what I want.
As far as I can tell the exact format of the data is bits, which, once I can
see them, I am going to convert to something meaningful.
--
Q: What is very old, used by farmers, and obeys the fundamental theorem of
arithmetic?
A: An antique tractorisation domain.
.
- Follow-Ups:
- Re: printf
- From: Ian Collins
- Re: printf
- References:
- printf
- From: Shane
- Re: printf
- From: Barry Schwarz
- Re: printf
- From: Shane
- Re: printf
- From: Ian Collins
- printf
- Prev by Date: Re: Bounds checking and safety in C
- Next by Date: Re: Malcolm's new book
- Previous by thread: Re: printf
- Next by thread: Re: printf
- Index(es):
Relevant Pages
|