Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- void *utolsooszlop(int t[], int sor, int oszlop)
- {
- int *uj=(int *)calloc(sor, sizeof(int));
- int i;
- for (i=0; i<sor; i++)
- uj[i]=t[i*oszlop+oszlop-1];
- return uj;
- }
- int main()
- {
- char *m[3][4]={{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}};
- int i, j;
- int *utolso;
- utolso=utolsooszlop(&m[0][0], 3, 4);
- for (i=0; i<3; i++)
- printf("%d\n", utolso[i]);
- return EXIT_SUCCESS;
- }
- /*
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- void kiir(int *t, int sor, int oszlop)
- {
- int i, j;
- for (i=0; i<sor; i++){
- for (j=0; j<oszlop; j++){
- putchar(' ');
- printf("%d", t[i*oszlop+j]);
- }
- }
- }
- int main()
- {
- char *m[3][4]={{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}};
- int i, j;
- kiir(m, 3, 4);
- return EXIT_SUCCESS;
- }
- */
- /*
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- int main()
- {
- char *m[3][4]={"januar", "februar", "marcius", "aprilis", "majus", "junius", "julius", "augusztus", "szeptember", "oktober", "november", "december"};
- int i, j;
- printf("%d, %d\n", sizeof(m), sizeof(char *));
- printf("%p (%u)\n", m, m);
- printf("%p (%u)\n", m+1, m+1);
- for (i=0; i<3; i++){
- for (j=0; j<4; j++){
- if (j>0)
- putchar(' ');
- printf("%s", m[i][j]);
- }
- putchar('\n');
- }
- return EXIT_SUCCESS;
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement