Thread: creating array

  1. #1
    Registered User
    Join Date
    Apr 2009
    Posts
    4

    creating array

    Hi

    Im very new to C and Im attempting to make an array that looks like this except much bigger:

    [][][][]
    [][][][]

    and in this array I would like put x's into some of the boxes based on user to make a picture, but im confused as to how to get started on this.

    Any help would be appreciated!

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Make a function to draw the array. When you are drawing it, leave a space for the X, for when it's not present, otherwise it will look like crap.

    Make a function to put an x at a specific spot. Get that input from the user, put it there, redraw the screen.

    Basically, you're just looking for an array of whatever size you choose, filled with spaces, that you swap out for Xs as needed.

    Start small. Make a 3x3 one, and once you have it working, go bigger. If you don't know how to use arrays, I'd suggest going to the library and getting a book on C, or searching the internet for some tutorials on the basics of C.


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

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Profiler Valgrind
    By afflictedd2 in forum C++ Programming
    Replies: 4
    Last Post: 07-18-2008, 09:38 AM
  2. Creating array of structs
    By knirirr in forum C++ Programming
    Replies: 12
    Last Post: 06-18-2008, 08:30 AM
  3. Creating Objects + Array
    By Cpro in forum C++ Programming
    Replies: 3
    Last Post: 04-01-2007, 11:14 PM
  4. Creating a menu that reads input via an array?
    By Nalif in forum C Programming
    Replies: 6
    Last Post: 09-29-2006, 09:21 PM
  5. Hi, could someone help me with arrays?
    By goodn in forum C Programming
    Replies: 20
    Last Post: 10-18-2001, 09:48 AM