You are not logged in.
Pages: 1
#include <stdio.h>
#define N 4
void main(){
int a[][N] = {{2},{3,3,1},{1,8,8,2},{3,1}},*b = *a,*c = *(a+N-1),i,j;
while(b < c) *b++ += *c--;
for(i = N; i > 0;i--) printf("%d ",(*a)[i-1]);
}
Can somebody explain to me wtf is this? :v
is b type of ( int *b ) and i,j are ( int ), how this works?
Last edited by ZoLA (2015-04-30 14:59:46)
Offline
No telling for sure, these (b & c) should already be defined. The *b and *a and *c are pointers.
Last edited by nomorewindows (2015-04-30 14:46:02)
I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.
Offline
I found my way around , a[][N] is matrix so type is (int **) after that there is no semicolon so initialization continues soo after that there is (int *b) (int *c) (int i) (int j)..
But thanks dude
Offline
I expanded the code a bit:
#include <stdio.h>
#define N 4
void main(){
int a[][N] = {{2},{3,3,1},{1,8,8,2},{3,1}};
int * b = a[0];
int * c = a[3];
int i;
int j;
while(b < c) {
i = c[0];
c -= 1;
b[0] += i;
b += 1;
}
for(i = N; i > 0;i--) {
printf("%d ",a[0][i-1]);
}
}
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |
Offline
Pages: 1