Point and Array Convert Problem


 
Thread Tools Search this Thread
Top Forums Programming Point and Array Convert Problem
# 1  
Old 02-25-2006
Point and Array Convert Problem

In this statement,"A[max][max]" of type "int",being converted to "pointer toarray[20] of int".(cvtdiftypes)

Please help me!

Code:
#include <stdio.h>
#include <stdlib.h>

int m,k; 
const int max =20;
int A[max][max];

//****************************************************
//     Input Matrix 
//****************************************************

void inMatrixAA(int AA[max][max], int row, int col)
{     int i,j; 
        for( i = 0; i<row; i++)
           {
               for( j = 0; j<col; j++)
                 scanf("%d",&AA[i][j]);
           }   
}

//*****************************************************
//   Print Matrix 
//***************************************************** 

void prMatrix( int AA[max][max], int row, int col) 
{       int i,j;
           for(i =0; i<row; i++)
              {
                 for(j = 0; j<col; j++) 
                   printf("%d\n",AA[i][j]);
              }
}

int main(int argc,char *argv[])
   {
       int ii,jj;
        for (ii = 0; ii<max;ii++)
         {
           for(jj =0;jj<max;jj++)
            {
              A[ii][jj] = 0;
            }
         }            
         printf("Enter values for m, k");
       scanf("%d",m,"%d");
       printf("Input Matrix A");
       inMatrixAA(A[max][max], m, k);
       printf("Print Matrix A");
       prMatrix(A[max][max], m, k);
   
   }

Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Convert a numeric to 2 decimal point value

Hi , I have a file which contains text like A|Mau|Code|12|Detail B|Mau|Code|20|Header I want to write a command using awk which will output A|Mau|Code|12.00|Detail B|Mau|Code|20.00|Header I used a command like awk -F"|" {printf "%s|%s|%s|%.2f|%s",$1,$2,$3,$4,$5}' which does the... (4 Replies)
Discussion started by: LoneRanger
4 Replies

2. Shell Programming and Scripting

Convert values in an array using a loop

I have a headerless array of 1000 columns x 100000 rows. The array only contains 4 values; 0/0, 0/1, 1/1, ./. Here I am showing the 1st 3 rows and columns of the input array 0/0 0/0 1/1 0/1 0/1 0/1 0/0 ./. 0/0 0/0 0/0 0/0 I would like to convert the values in... (9 Replies)
Discussion started by: Geneanalyst
9 Replies

3. Shell Programming and Scripting

Convert floating point to a number

Hello Guys, I have a floating point number 1.14475E+15 I want to convert this number in to full number (Integer or Big integer). I tried couple of functions it did not work. When I use INT=${FLOAT/.*} I am getting value as 1. I don't want a truncated value #!/bin/bash #... (9 Replies)
Discussion started by: skatpally
9 Replies

4. Shell Programming and Scripting

Convert decimal notation to ANSI point code notation

wondering if anyone has any thoughts to convert the below thru a shell script Convert decimal signalling point notation to ANSI point code notation There is a site that does that conversion but i need to implement the solution in a shell script.....Thoughts.... OS: Solaris 9 ... (4 Replies)
Discussion started by: aavam
4 Replies

5. Shell Programming and Scripting

Convert array data to excel format

I need your help in changing the script I have data has below text file :> cat my_emp Employee array(0) Name : Albert No : 1234 Address: stationstraat City: Utrecht Employee array (1) Name : Kouwen No : 1256 Address: stationstraat City: Amsterdam Employee array (2) Name : Peter... (2 Replies)
Discussion started by: LinuxLearner
2 Replies

6. Shell Programming and Scripting

how to convert array into the string

Hi I have a line/string as follows: A=" 3498 NORDEA - INDX LINKED NORY" which was converted into an array of characters: p321$ echo "${ARR}" 3 4 9 8 N O R D E A - I N D X L I N K E D N O R Y When I am trying print this array there are blank... (4 Replies)
Discussion started by: aoussenko
4 Replies

7. Shell Programming and Scripting

convert variable content to array

Hi All, I have a variable in a shell script which holds let say n paarmeteres with space separate them : $var = par1 par2 par3 par4 parn; so if I print this variable this is what I'll see: par1 par2 par3 par4 parn I need to insert each parameter to an array , so I can go over on each... (3 Replies)
Discussion started by: Alalush
3 Replies

8. Solaris

can array store float point numbers

Hi all, I have doubt can array in a shell script can store floating point numbers. i have tired. but i unable to work it out. Please help me regarding this Thank U Naree (1 Reply)
Discussion started by: naree
1 Replies

9. Solaris

i cannot assign float point numbers to an array in solaris

total=0 declare -a sum limit=`iostat -En | grep -i size | awk '{print $2}' | sed -e 's/GB//g' | wc -l` echo "Limit is equal to $limit" ara="`iostat -En | grep -i size | awk '{print $2}' | sed -e 's/GB//g'`" for (( i=1; i<=$limit; i++ )) do sum=`echo $ara | cut -d " " -f $i` echo ${sum}... (11 Replies)
Discussion started by: naree
11 Replies
Login or Register to Ask a Question