Thread: How can I put a 2d array into a frame?

  1. #1
    Registered User
    Join Date
    Apr 2011
    Posts
    3

    How can I put a 2d array into a frame?

    I am new to C and I am trying to input a 2d array from the user (integers) and want when the program prints the array it would simply be printed with a frame of for example "& or $" any symbol.

    This is how the input is:
    1 2 3
    4 5 6
    7 8 9

    and the output should be like this:
    Code:
        a b c
      & & & & &
    a & 1 2 3 &
    b & 4 5 6 &
    c & 7 8 9 &
      & & & & &
    later the input of the user will change and the frame shouldn't change, is there anyway to make two 2d arrays to print into each other, so no matter what i change in one array wont effect the other and they will print this way, assuming the ratio of both arrays will always be this way? I been trying to do this for a while now but nothing is working.
    Last edited by blaze505; 04-27-2011 at 12:07 AM.

  2. #2
    Registered User
    Join Date
    Aug 2010
    Location
    Rochester, NY
    Posts
    196
    Please don't come here with homework assignments and ask the people here to do them for you. Think about the problem, come up with an idea. Don't say you came up with 'nothing' - you've come up with something, I'm sure, tell us what you've found..

    This isn't a place where people just give answers..

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,656
    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.

  4. #4
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by Syndacate View Post
    This isn't a place where people just give answers..
    Answers: yes ... Free code: no

  5. #5
    Registered User
    Join Date
    Aug 2010
    Location
    Rochester, NY
    Posts
    196
    What's the point in even taking the class if you're trying to cheat your way out of it? You don't learn by somebody giving you the code. What's the purpose? Why not just withdraw/drop the course?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Get Frame Width
    By Brad0407 in forum Windows Programming
    Replies: 2
    Last Post: 07-10-2007, 07:26 PM
  2. Replies: 3
    Last Post: 09-17-2006, 08:13 AM
  3. Frame? Are they in c++?
    By MK4554 in forum Windows Programming
    Replies: 3
    Last Post: 07-08-2006, 07:22 AM
  4. Moving a frame
    By Tperry23 in forum C# Programming
    Replies: 1
    Last Post: 09-25-2005, 04:56 PM
  5. Resize frame
    By Eugene in forum Windows Programming
    Replies: 4
    Last Post: 12-20-2001, 11:37 PM