int * ptr; |
int i = 1; int *ptr = &i; |
int i = 1; int *ptr = &i; |
int i = 1; int *ptr = &i; *ptr = 2; printf ("%d\n", i); |
int i = 1; int *ptr = &i; *ptr = 2; printf ("%d\n", i); |
int i = 1; int *ptr = &i; *ptr = 2; printf ("%d\n", i); |
int i = 1; int *ptr = &i; *ptr = 2; printf ("%d\n", i); |
int i = 42; int j = 17; int *ptr = &i; *ptr = 1; ptr = &j; *ptr = 2; |
int i = 42; int j = 17; int *ptr = &i; *ptr = 1; ptr = &j; *ptr = 2; |
int i = 42; int j = 17; int *ptr = &i; *ptr = 1; ptr = &j; *ptr = 2; |
int i = 42; int j = 17; int *ptr = &i; *ptr = 1; ptr = &j; *ptr = 2; |
int i = 42; int j = 17; int *ptr = &i; *ptr = 1; ptr = &j; *ptr = 2; |
int i = 42; int j = 17; int *ptr = &i; *ptr = 1; ptr = &j; *ptr = 2; |
int i = 42; int j = 17; int *ptr = &i; *ptr = 1; ptr = &j; *ptr = 2; |
&j = &i |
int i; int *ptr = &i; |
double d; int *ptr = &d; |
int * ptr; |
int *p; |
int i; int *p = &i; |
int i; int *p = &i; *p = 3; |
#include |
#include |
#include |
#include |
#include |
#include |
#include |
#include |
#include |
#include |
void swap (int *a, int *b) { int tmp; tmp = *a; *a = *b; *b = tmp; } |
void swap (int *a, int *b) { int tmp; tmp = *a; *a = *b; *b = tmp; } |
/* * power: calculate m to the nth power */ long *power (int m, int n) { int i; int product = 1; for (i = 1; i <= n; ++i) product *= m; return &product; } |
/* * power: calculate m to the nth power */ long *power (int m, int n) { int i; int product = 1; for (i = 1; i <= n; ++i) product *= m; return &product; } |