Thread: transpose matrix

  1. #1
    Registered User
    Join Date
    Apr 2003
    Posts
    17

    Angry transpose matrix

    i'm have been trying to run this transpose matrix, but it will not run..please help correct my error..here is what i have.

    #include<stdio.h>
    int main()

    {
    int First[2][2];
    int second[2][2];
    int i,j;
    int tran_Matrix, Orig_Matrix;
    for( i = 0; i < 2; i++ )
    {
    for( j = 0; j < 2; j++ )
    printf("enter value:");
    scanf("%d", &First[i][j]);
    }
    printf("\n");

    tran_Matrix[i][j] = Orig_Matrix[j][i];

    printf("\ntran_Matrix");
    }

  2. #2
    * Death to Visual Basic * Devil Panther's Avatar
    Join Date
    Aug 2001
    Posts
    768
    You declared: int tran_Matrix, Orig_Matrix;

    and yet trying: tran_Matrix[i][j] = Orig_Matrix[j][i];


    It doesn't work this way, maybe you meant:
    second[i][j] = First[j][i];
    "I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe

    http://www.Bloodware.net - Developing free software for the community.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C - access violation
    By uber in forum C Programming
    Replies: 2
    Last Post: 07-08-2009, 01:30 PM
  2. Matrix Help
    By HelpmeMark in forum C++ Programming
    Replies: 27
    Last Post: 03-06-2008, 05:57 PM
  3. Help with matrix transpose
    By sass208 in forum C Programming
    Replies: 6
    Last Post: 12-09-2006, 02:02 AM
  4. Matrix and vector operations on computers
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 11
    Last Post: 05-11-2004, 06:36 AM