Re: printf



dan wrote:

On Jul 30, 7:41 pm, Shane <sh...@xxxxxxxxxxxxxxxxxxxx> wrote:
Barry Schwarz wrote:
On Tue, 31 Jul 2007 14:33:29 +1200, Shane <sh...@xxxxxxxxxxxxxxxxxxxx>
wrote:

Hi all, I am learning C, and I have a problem with printf.
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.

What is the exact type of the pointer?

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



Remove del for email

--
Q: What's yellow, normed, and complete?
A: A Bananach space.

By example, I think Barry means an example program that can be
compiled. Otherwise, nobody can understand what you're saying exactly.

Daniel Goldman

Ah, my mistake.

Unfortunately I dont think any code I provide will clear things up further
(The pointers are returned from librarys that arent, in my limited
experince, well documented.)

Suffice to say I have tried
printf((char *)pointer_to_bin_data);
and
printf((int *)pointer_to_bin_data);

I appreciate this is far less than what you are asking for, but is all I
able to provide at this point.
--
Math problems? Call 1-800-[(10x)(13i)2]-[sin(xy)/2.362x].

.



Relevant Pages