Thread: Question on an array practice problem

  1. #1
    Registered User
    Join Date
    Jan 2002
    Posts
    25

    Question on an array practice problem

    This is a practice problem for class that has me stumped. I am very new to C, so please don't flame. I am stuck on a simple array problem for class, but I cannot figure out what to do next. Here is the link, it is under Lab1_6. http://technology.cs.hcc.cc.il.us/fa...directions.htm The one with the picture of the X in the box. I now how to set up nested for loops to fill the 11x11 array with the * character and how to print the array to the screen. But trying to get the x in the box using the loops has me stumped. I think I am going to have to use a a space char to make the x, but not sure how to do that. Any help would be greatly appreciated

    Vanished

  2. #2
    Registered User
    Join Date
    Jan 2002
    Posts
    552
    You should be able to figure this one out. The answer isnt much harder than indexing an array. Just think about the steps needed to accomplish this...

    Set element (0,0) to '*'
    Set element (1,1) to '*'
    Set element (2,2) to '*'
    .
    .
    .
    Set element (10, 10) to '*'


    Set element (10, 0) to '*'
    Set element (9, 1) to '*'
    .
    .
    .

    Take a stab at it, you'll never become a better programmer if you dont attempt (relatively) difficult tasks
    Last edited by *ClownPimp*; 01-22-2002 at 07:18 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 07-11-2008, 07:39 AM
  2. Problem with Dynamically Increasing Array of Integers
    By laserlight in forum C++ Programming
    Replies: 30
    Last Post: 07-04-2008, 07:27 AM
  3. Class Template Trouble
    By pliang in forum C++ Programming
    Replies: 4
    Last Post: 04-21-2005, 04:15 AM
  4. linked list inside array of structs- Syntax question
    By rasmith1955 in forum C Programming
    Replies: 14
    Last Post: 02-28-2005, 05:16 PM
  5. Replies: 6
    Last Post: 10-21-2003, 09:57 PM