This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
user:mgardne8:portfolio:notescrap [2014/09/02 14:00] – mgardne8 | user:mgardne8:portfolio:notescrap [2014/09/02 14:28] – mgardne8 | ||
---|---|---|---|
Line 1: | Line 1: | ||
__Pointers__ | __Pointers__ | ||
- | Inf a; | + | int = 4 bytes |
+ | short = 2 bytes | ||
- | Grid - 1byte = 8bits | + | Int a = 5; (43; |
+ | Int b = 6; (47; | ||
+ | Short j = 2; (53;54) | ||
+ | Short k = 1; (55;56) | ||
+ | Int *c = &a; (57; | ||
+ | | ||
+ | [* = Dereferencing operator] | ||
+ | Short q = 77; (67;70) | ||
- | 2^8 | + | |0|1|2|3|4|5|6|7| |
+ | ------------------ | ||
+ | 0| | | | | | | | | | ||
+ | ------------------ | ||
+ | 1| | | | | | | | | | ||
+ | ------------------ | ||
+ | 2| | | | | | | | | | ||
+ | ------------------ | ||
+ | 3| | | | | | | | | | ||
+ | ------------------ | ||
+ | 4| | | |a|a|a|a|b| | ||
+ | ------------------ | ||
+ | 5|b|b|b|j|j|k|k|c| | ||
+ | ------------------ | ||
+ | 6|c|c|c|c|c|c|c|q| | ||
+ | ------------------ | ||
+ | 7|q| | | | | | | | | ||
+ | ------------------ | ||
- | | + | ---------------------------- |
- | | + | |
- | 0| | | | | | | | | | | + | ---------------------------- |
- | | + | |
- | | + | |
- | -------------------- | + | |
- | 2| | | | | | | | | | | + | |
- | | + | |
- | | + | --------------------------- |
- | | + | |
- | | + | --------------------------- |
- | | + | |
- | | + | |
- | -------------------- | + | |
- | 6| | | | | | | | | | | + | |
- | | + | |
- | | + | |
- | -------------------- | + | |
- | 8| | | | | | | | | | | + | |
- | | + | |
- | ____________________________________________________________________________ | + | int g[4]; |
- | bc -l | + | int *g=(int *)malloc(sizeof(int)*4); |
+ | |||
+ | g[0] | ||
+ | g[1] | ||
+ | *(g+2) = 13; | ||
+ | g[2] | ||
- | 2^8 = 256 | ||
- | 2^16 = 65536 | ||
- | 2^32 = 4294967296 | ||
- | |||
- | 2^64 = 18446744073709551616 | ||