Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- void foo(int*);
- ///////////////////////////////////////
- int main()
- {
- int n1 = 1;
- foo(&n1);
- printf("n1 = %d\n", n1);
- }
- ///////////////////////////////////////
- void foo(int *p)
- {
- *p = *p + 22;
- }
- /*
- #include <stdio.h>
- void foo(int);
- ///////////////////////////////////////
- int main()
- {
- int n1 = 1;
- printf("address n1 = %d\n", &n1);
- foo(n1);
- }
- ///////////////////////////////////////
- void foo(int n1)
- {
- printf("address n1 = %d\n", &n1);
- n1 = n1 + 22;
- printf("n1 = %d\n", n1);
- }
- */
- /*
- #include <stdio.h>
- void foo(int, int);
- ///////////////////////////////////////
- int main()
- {
- int n1 = 1, // lkjlkjklj
- n2 = 2; // lkjklj lkjkljlkj
- printf(" n1 = %d\n", n1);
- printf("address n1 = %d\n", &n1);
- int *p1 = &n1;
- printf(" n1 = %d\n", *p1);
- printf("address n1 = %d\n", p1);
- }
- */
- /*
- #include <iostream>
- using namespace std;
- void foo(int, int);
- ///////////////////////////////////////
- int main()
- {
- int n1 = 1, // lkjlkjklj
- n2 = 2; // lkjklj lkjkljlkj
- foo(n1, n2);
- }
- ///////////////////////////////////////
- void foo(int n, int n3)
- {
- if(n > n3) cout << n ;
- else cout << n3;
- }
- */
- /*
- #include <stdio.h>
- #include <iostream>
- using namespace std;
- void foo(int n);
- ///////////////////////////////////////
- int main()
- {
- int a = 10;
- do
- {
- foo(a);
- a -= 1;
- } while(a >= 2);
- return 0;
- }
- ///////////////////////////////////////
- void foo(int n)
- {
- int i = 1;
- L_01:
- // cout.width(2);
- // cout << n << " x ";
- // cout.width(2);
- // cout << i << " = " << cout.width(3) << n*i << "\n";
- cout.width(2);
- cout << n << " x ";
- cout.width(2);
- cout << i << " = ";
- cout.width(3);
- cout << n*i << "\n";
- //printf("%2d * %2d = %3d\n", n, i, n*i);
- i++;
- if(i <= 10) goto L_01;
- cout<<"------------- " << endl;
- }
- */
- /*
- #include <iostream>
- using namespace std;
- void foo(int n);
- ///////////////////////////////////////
- int main()
- {
- int a = 4;
- do
- {
- foo(a);
- a -= 1;
- } while(a >= 2);
- return 0;
- }
- ///////////////////////////////////////
- void foo(int n)
- {
- int i = 1;
- L_01:
- cout << n << " x " << i << " = " << n*i << "\n";
- i++;
- if(i <= 9) goto L_01;
- cout<<"------------- " << endl;
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement