Thread: Declaring the 'row' for my matrix - problems

  1. #1
    Registered User
    Join Date
    Feb 2009
    Posts
    19

    Declaring the 'row' for my matrix - problems

    Hi,

    I must be doing something wrong; I am trying to get the user to input the 'row' index value for my 2D matirx array.

    Code:
    printf("Enter the row value for the output: ");
    			scanf("%d", &matrix[outputrow][1]);
    Could some please show me how to get this to work. The 'outputrow' is an int variable, and I want to get the user to specify it. But it doesn't do I expeted it to do. The column is predefined at 1, as I only want the user to specify the row value.

    Does anyone have any ideas?

    Thanks

  2. #2
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    scanf("%d", &outputrow);

    Then you can work with it inside your matrix, as a row indicator.

  3. #3
    Registered User
    Join Date
    Feb 2009
    Posts
    19
    Thankyou

  4. #4
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    You're very welcome.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Music Programming - Serial Matrix Display (Help needed)
    By CrazyHorse in forum C Programming
    Replies: 1
    Last Post: 11-13-2007, 04:28 PM
  2. Music Programming - Serial Matrix Display
    By CrazyHorse in forum C Programming
    Replies: 1
    Last Post: 11-12-2007, 04:16 PM
  3. problems with matrix mult. method
    By Captain Penguin in forum C++ Programming
    Replies: 1
    Last Post: 03-27-2003, 09:05 AM
  4. Dynamically SIzed Global Matrix problems
    By Josh Kasten in forum C++ Programming
    Replies: 2
    Last Post: 01-18-2003, 11:51 PM
  5. Problems With Declaring Identifiers
    By rslam01 in forum C++ Programming
    Replies: 1
    Last Post: 09-29-2002, 04:54 PM