Quote:Original post by BeanDogQuote:Original post by Splinter of Chaos
If I understand what you want, you should use a pointer. Technically, it's an integer that can be set to constant that can be substituted for the value of a string.
Ah, where's Zahlman when you need him to explain the deep doctrine of the difference between integers and pointers?
Technically, I'm the minion in charge of that doctrine [wink]
Splinter of Chaos: there are two ways to look at the "pointers are integers" statement. The first way is to notice that pointers and integers behave differently: pointer arithmetic and comparison is based on a buffer-offset definition, which means it's unsafe to compare the order of pointers to objects that are not within the same buffer, or to add random offsets to pointers. Sure, pointers can be converted to and from integers, but it's not a morphism (the various operations on integers don't match the operations on their associated pointers). In that perspective, pointers and integers are not the same.
The other way is to notice that pointers are represented, at the machine level, as a sequence of bits. On many platforms, this sequence has the same size and storage locations as an integers (though this is not necessarily the case). And so, like 99% of any data inside a computer, pointers are actually integers. This is, of course, not really useful because of the generality of that statement.