Thread: pointers and arrays in C
i need pointers , arrays in c. i'm trying make function follows
after start scanning items want check if user enters character using isalpha() function. if user enters character want scanf() element character type , keep entering elements integers. can me this?code:void matrix_new(int **matrices, int *rows, int *cols){ //function enter arrays 20 21 *rows = &matrices[0][1]; //this check number of rows 22 *cols = &matrices[0][2]; //this check number or columns 23 int i, j; 24 26 for(i = 0; < *rows; i++){ 27 for(j = 0; j < *cols; j++){ 28 if(i==0 && j==0){ 29 scanf("%c", matrices[i][j]); 30 } 31 if(i==0 && j==1){ 32 scanf("%c", matrices[i][j]); 33 } 34 for(i=4; i<*rows; i++){ 35 scanf("%d", matrices[i][j]); 36 /*now what*/ 37 38 } 39 }
thread moved programming talk.
Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk pointers and arrays in C
Ubuntu
Comments
Post a Comment