Graeme Geldenhuys wrote: > On 2 February 2012 00:14, Michael Van Canneyt wrote: >> >> Ehm.. this should be S[1], now you're writing the pointer. > > > Thank you. That's what happens if you have too many very late nights > programming - sleep deprivation catches up and one overlooks the > simple mistakes. > > >
It's actually a common mistake. Also @s vs "s", and @s[1], it can be confusing. It's one thing I don't like about unsafe languages, pointers, and such stuff. It's as if we are programming in advanced C, or C++. Common, pointer mistakes? this is C? Really? Can't we make it safer? LOL. What could be done to make this safer? I don't know. What does java do in a situation like this? Could we learn from it? If somehow the compiler could statically check that only s[1] is allowed, and not S, that would be good. _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal