8-Aug-00 15:10 you wrote:
. Eike Lange wrote:
Am Die, 08 Aug 2000 schrieb Khimenko Victor:
Ahh. So it's array, not just pointer. In this case something like type mysqlrowa=array[0..100] of CString; mysqlrow=^mysqlrowa; will do. And you can use row^[0], row^[1], ... , row^[100] (there are no limit in C but in Pascal you NEED some limit - otherwise compiler will complain).
Ok, thats not exactely what I want to do. What about row[10000]? But if there is no direct equivalence, I try out some other ideas.
Victor is right: This is the direct equivalent.
In C, every pointer can be used as a pointer to an array of the target type, and the identifier of every array (without the []) represents the address of the array, not the array itself.
In this sense, there are either no real arrays in C, or there are no real pointers, only pointers to arrays. ;-)
There are no real arrays in C AND there are no real pointers. This is C strenght and this is disaster as well.
Concerning enumerated types, GNU Pascal uses the same backend as GNU C does. If there is no striking reason to change this one day, I'd vote for fixing this as a feature of compatibility to GNU C.
Hmm. Surely this program must emit run-time error: -- cut -- type my_type=(a,b,c); var x:my_type; function my_proc(x:my_type):my_type; begin my_proc:=pred(x); end; begin x:=my_proc(a); end. -- cut -- I was unable to get one but I think it's temporary limitation, right ? C have no operations for enums while Pascal have so I'm not sure if GCC backend is powerfull enough for Pascal...