Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- struct T
- {
- float f;
- int n;
- };
- void foo(T *pt);
- //////////////////////////////////////////////
- int main()
- {
- T t1, t2, tArr[9];
- t1.f = 12.34;
- t1.n = 5555;
- foo(&t1);
- }
- //////////////////////////////////////////////
- void foo(T *pt)
- {
- printf("%.2f, %d", pt->f, (*pt).n);
- }
- /*
- #include <stdio.h>
- void foo(char *lkjkljlkjklj);
- //////////////////////////////////////////////
- int main()
- {
- char sz[99] = "SONY Pictures";
- foo(&(&sz[1])[-1]);
- }
- ///////////////////////////////////////////////
- void foo(char *psz)
- {
- for(int i = 0; i < 4; i++)
- {
- printf("%c, ", psz[i]);
- }
- }
- */
- /*
- #include <stdio.h>
- void foo(int arr[]);
- //////////////////////////////////////////////
- int main()
- {
- int nArr[99] = {10, 111, 123};
- printf("const = %d\n", 77);
- foo(nArr);
- return 0;
- }
- ///////////////////////////////////////////////
- void foo(int *pArr)
- {
- for(int i = 0; i < 4; i++)
- {
- printf("%d, ", pArr[i]);
- }
- }
- */
- /*
- #include <stdio.h>
- void foo(int arr[]);
- //////////////////////////////////////////////
- int main()
- {
- int nArr[99] = {10, 11, 12};
- printf("const = %d\n", 77);
- foo(nArr);
- return 0;
- }
- ///////////////////////////////////////////////
- void foo(int arr[])
- {
- for(int i = 0; i < 4; i++)
- {
- printf("%d, ", arr[i]);
- }
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement