Using write() to print array elements

This is a discussion on Using write() to print array elements within the C Programming forums, part of the General Programming Boards category; I don't know how to print single array elements to the screen using write()...

  1. #1
    Unregistered
    Guest

    Unhappy Using write() to print array elements

    I don't know how to print single array elements to the screen using write()

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Why on earth would you use write? Use printf or something useful...

    int array[4] = { 1, 22, 333, 4444 };
    printf("%d", array[0] );
    printf("%d", array[1] );
    printf("%d", array[2] );
    printf("%d", array[3] );


    Quzah.
    Hope is the first step on the road to disappointment.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. coping elements not in array
    By lord in forum C++ Programming
    Replies: 2
    Last Post: 08-04-2008, 08:53 PM
  2. count elements in an array
    By whichet in forum C Programming
    Replies: 9
    Last Post: 11-25-2007, 08:05 AM
  3. Personal Program that is making me go wtf?
    By Submeg in forum C Programming
    Replies: 20
    Last Post: 06-27-2006, 01:13 AM
  4. Unknown Memory Leak in Init() Function
    By CodeHacker in forum Windows Programming
    Replies: 3
    Last Post: 07-09-2004, 10:54 AM
  5. Template Array Class
    By hpy_gilmore8 in forum C++ Programming
    Replies: 15
    Last Post: 04-12-2004, 12:15 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21