From 7e0f021a9aec35fd8e6725e87e3313b101d26f5e Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Sun, 27 Jan 2008 11:37:44 +0100 Subject: Initial import (2.0.2-6) --- reference/C/CONTRIB/SNIP/storage.typ | 78 ++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100755 reference/C/CONTRIB/SNIP/storage.typ (limited to 'reference/C/CONTRIB/SNIP/storage.typ') diff --git a/reference/C/CONTRIB/SNIP/storage.typ b/reference/C/CONTRIB/SNIP/storage.typ new file mode 100755 index 0000000..1203112 --- /dev/null +++ b/reference/C/CONTRIB/SNIP/storage.typ @@ -0,0 +1,78 @@ + STORAGE TYPES + + A C language crib sheet from Jeff Galbraith + + +int x; + - x is an int. + +int *x; + - x is a pointer to an int. + +int **x; + - x is a pointer to a pointer to an int. + +const int x; + - x is a const int (constant integer). + +const int *x; + - x is a pointer to a const int. The value of x may change, but + the integer that it points to not be changed. In other words, + x cannot be used to alter the value to which it points. + +int *const x; + - x is a constant pointer to an int. The value may not change, + but the integer that it points to may change. In other words, + x will always point at the same location, but the contents may + vary. + +const int *const x; + - x is a constant pointer to a constant integer. The value of x + may not change, and the integer that it points to may not + change. In other words, x will always point at the same + location, which cannot be modified via x. + +int x[]; + - x is an array of int. + +int x[99]; + - x is an array of 99 int's. + +int *x[]; + - x is an array of pointers to int. + +int (*x)[]; + - x is a pointer to an array of int. + +int *(*x)[]; + - x is a pointer to an array of pointers to int. + +int F(); + - F is a function returning int. + +int *F(); + - F is a function returning a pointer to int. + +int (*x)(); + - x is a pointer to a function returning int. + +int (*x[99])(); + - x is an array of 99 pointers to functions returning int. + +int (*F())(); + - F is a function returning a pointer to a function returning int. + +int *(*F())(); + - F is a function returning a pointer to a function returning a + pointer to an int. + +int (*F())[]; + - F is a function returning a pointer to an array of int. + +int (*(*F())[])(); + - F is a function returning a pointer to an array of pointers to + functions returning int. + +int *(*(*F())[])(); + - F is a function returning a pointer to an array of pointers to + functions returning a pointer to int. -- cgit v1.2.3-54-g00ecf