Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- void foo(char *);
- ////////////////////////////////////////
- int main() //
- {
- char sz[11] = "SONY"; //{20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30};
- foo(&sz[2]);
- }
- ////////////////////////////////////////
- void foo(char *p)
- {
- p -= 2;
- printf("p[0] = %c \n", p[0]);
- printf("p[1] = %c \n", p[1]);
- }
- /*
- #include <stdio.h>
- void foo(int *);
- ////////////////////////////////////////
- int main() //
- {
- int nArr[11] = {20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30};
- foo(&nArr[1]);
- }
- ////////////////////////////////////////
- void foo(int *p)
- {
- printf("nArr[0] = %d \n", p[0]);
- printf("nArr[1] = %d \n", p[1]);
- }
- */
- /*
- void foo(int *);
- ////////////////////////////////////////
- int main() //
- {
- int nArr[11] = {20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30};
- foo(&nArr[0]);
- }
- ////////////////////////////////////////
- void foo(int *nArr)
- {
- printf(" nArr = %d \n", nArr );
- printf(" nArr = %d \n", &nArr[0]);
- printf("&nArr[1] = %d \n", &nArr[1]);
- }
- */
- /*
- #include <stdio.h>
- int n = 444;
- int *p = &n;
- ////////////////////////////////////////
- int main() //
- {
- printf(" n = %d \n", &n);
- printf(" p = %d \n", p);
- printf(" n = %7d \n", n);
- printf("*p = %7d \n", *p);
- }
- */
- /*
- #include <stdio.h>
- int n = 444;
- int *p = &n;
- ////////////////////////////////////////
- int main() //
- {
- printf("n = %d\n", &n);
- printf("p = %d\n", p);
- // printf("n = %d\n", &n);
- printf("sizeof(p) = %d\n", sizeof(p));
- printf("sizeof(n) = %d\n", sizeof(char));
- }
- */
- /*
- #include <stdio.h>
- int n = 444;
- int *p = 0;
- ////////////////////////////////////////
- int main() //
- {
- }
- */
- /*
- #include <stdio.h>
- void foo(int*);
- ////////////////////////////////////////
- int main() //
- {
- int nArr[11] = {20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30};
- foo(nArr);
- int i = 0;
- L_01: if(i < 11) // çàäàåì goto
- {
- printf("%d ", nArr[i]);
- i ++;
- goto L_01;
- }
- return 0;
- }
- ////////////////////////////////////////
- void foo(int *nArr) //
- {
- int i = 0;
- L_01: nArr[i] = nArr[i] -10; // çàäàåì goto
- i++;
- if(i < 11) goto L_01;
- }
- */
- /*
- #include <stdio.h>
- void foo(int*, int*);
- ////////////////////////////////////////
- int main() //
- {
- int nArr[11] = {20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30},
- newarr[11];
- foo(nArr,newarr);
- int i = 0;
- L_01: if(i < 11) // çàäàåì goto
- {
- printf("%d ",newarr[i]);
- i ++;
- goto L_01;
- }
- return 0;
- }
- ////////////////////////////////////////
- void foo(int *nArr, int *newarr) //
- {
- int i = 0;
- gt: if(i < 11) // çàäàåì goto
- {
- newarr[i] = nArr[i]-10;
- i++;
- goto gt;
- }
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement