Printing out Byte in C


 
Thread Tools Search this Thread
Top Forums Programming Printing out Byte in C
# 1  
Old 12-03-2007
Printing out Byte in C

Hi all,

Can anyone advise on how to display the data in a byte[24] variable, i.e can i use printf("%s", vairable_name);?

Cheers
# 2  
Old 12-03-2007
Either use a loop and print each byte with

Code:
int i=0;
byte byte_array[24];

while (i < sizeof(byte_array))
{
     print("%02X",(int)byte_array[i]);
     i++;
}

or build up the string yourself.
# 3  
Old 12-04-2007
Thanks, Porter!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Sco Unix printing : jobs hangs in queue - printing via lp versus hpnpf

Hi, We have a Unix 3.2v5.0.5. I installed a printer via scoadmin, HP network printer manager with network peripheral name (hostname and ipadres are in /etc/hosts). This is the configuration file : Code: root@sco1 # cat configurationBanner: on:AlwaysContent types: simpleDevice:... (0 Replies)
Discussion started by: haezeban
0 Replies

2. Windows & DOS: Issues & Discussions

Linux to Windows Printing: PDF starts printing from middle of page.

We are using Red Hat. We have a issue like this: We want to print from Linux, to a printer attached to a Windows machine. What we want to print is a PDF. It prints, but the printing starts from the middle of the page. In the report, there is no space at the top but still printing starts from the... (5 Replies)
Discussion started by: rohan69
5 Replies

3. IP Networking

Total byte

Hi I've a pkts trace and I'm performing some test on it. I'd like to figure out also the numbers of total byte in that trace. Any idea? thanks in advance D. (0 Replies)
Discussion started by: Dedalus
0 Replies

4. Shell Programming and Scripting

delete zero byte file

Hello I have a requirement where i need to find the zero byte size file in the directory and need to delete that zero byte file. Thanks (2 Replies)
Discussion started by: dsdev_123
2 Replies

5. Shell Programming and Scripting

Remove a byte(Last byte from the last line)

Hi All Can anyone please suggest me how to remove the last byte from a falt file .This is from the last line's last BYTE. Please suggest me something. Thank's and regards Vinay (1 Reply)
Discussion started by: vinayrao
1 Replies

6. Shell Programming and Scripting

Check if 2 files are identical byte-to-byte?

In my server migration requirement, I need to compare if one file on old server is exactly the same as the corresponding file on the new server. For diff and comm, the inputs need to be sorted. But I do not want to disturb the content of the file and need to find byte-to-byte match. Please... (4 Replies)
Discussion started by: krishmaths
4 Replies

7. Shell Programming and Scripting

0 byte file with no name????

Please help me in removing the 2nd file : -rw-rw-rw- 1 fup03a fup03a 9216 Aug 16 00:45 med_delay_log -rw-rw-rw- 1 fup03a fup03a 0 Aug 16 18:04 (5 Replies)
Discussion started by: miltonkeynesguy
5 Replies

8. Programming

Byte Padding

Hi, Can someone explain what is byte padding? For ex: struct emp{ char s; int b; char s1; int b1; long b3; char s3; } What will be the size of this structure? Thanks (6 Replies)
Discussion started by: naan
6 Replies

9. Shell Programming and Scripting

zero byte with String

My program would be creating a file, incase of non data from database it would only able to produce 'END, logically it would be file created by oracle in unix. this file is showing zero byte but actully there are 4 char in file.This is not required, therefore what is command line should be... (0 Replies)
Discussion started by: u263066
0 Replies

10. UNIX for Advanced & Expert Users

Printing Problems in unix ... ( Bar-cdoe - Ip Printing)

Hi guys ... i need ur help with some printing problem in unix ... first prob. : i wanna print from my NCR unix to an Win NT , Ip based printing server ( HP JetDirect ) . My issue , is it possible to print directly to an Ip address from unix ? How do i make it work to get any results ?... (3 Replies)
Discussion started by: QuickSilver
3 Replies
Login or Register to Ask a Question