Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #define MAX_SIZE 6
- struct point {
- int x;
- int y;
- };
- int PrintArray(int *arr, int size);
- int PrintPoint(struct point pt);
- int main(int argc, char *argv[])
- {
- int arri[MAX_SIZE] = {10, 20, 30, 40, 50, 0};
- struct point pt;
- pt.x = 10;
- pt.y = 20;
- PrintPoint(pt);
- PrintArray(arri, MAX_SIZE);
- PrintArray(arri, 3);
- pt.x = 100;
- pt.y = 200;
- PrintPoint(pt);
- //System("PAUSE");
- return 0;
- }
- int PrintArray(int *arr, int size)
- {
- int i;
- for(i=0; i<size; i++)
- {
- printf("Arri[%d] = %d\n", i, arr[i]);
- }
- return 0;
- }
- int PrintPoint(struct point pt) {
- printf("Point x = %d, y = %d\n", pt.x, pt.y);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment