Thread: How to print columns of a 2d array as one string

  1. #1
    Registered User
    Join Date
    May 2022
    Posts
    18

    How to print columns of a 2d array as one string

    insert
    Code:
    char matrix[10][10] = { 'H', 'e', 'l', 
                                         'l' , 'o', 'I'}

    So my expected output is HleolI.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,154
    Where you would use
    for ( row
    for ( col

    to print "HelloI"

    You would use
    for ( col
    for ( row

    to print "HleolI"
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 1
    Last Post: 10-30-2019, 08:59 PM
  2. number of columns and lines in my array
    By funnydarkvador in forum C++ Programming
    Replies: 27
    Last Post: 03-12-2013, 03:16 PM
  3. Swapping Rows and Columns in a 2D array
    By xxshankar in forum C Programming
    Replies: 2
    Last Post: 03-11-2010, 03:40 PM
  4. Replies: 2
    Last Post: 10-23-2009, 05:19 PM
  5. sum rows & columns in array
    By ronenk in forum C Programming
    Replies: 7
    Last Post: 06-20-2004, 04:16 AM

Tags for this Thread