Restored from previous forum. Originally posted by Stan.
Unless I missed it, there no way to cast pointers, seems PB is VERY
peeky about that ... ( I suppose this is related to the parsing/compilation
method ). As an old C programmer I really miss it !
Any suggestion ?
Stan
Learning and Love are what life is all about ... [ PB. registered user ]
Casting Pointers
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Pupil.
Hope it helps somewhat, if not perhaps a little further explaining of what 'casting' means might clear things for me.
I don't quite understand what you're looking for, but could it possible be something like this:Something like :
*Byte_ptr.b
String_one.s = "xxx"
*Byte_ptr = () @String_one
Code: Select all
Structure chartype
char.b
EndStructure
string.s="hello"
*byte_ptr.chartype=@string
For i=1 To Len(string)
new_string.s+Chr(*byte_ptr\char)
*byte_ptr+1
Next
MessageRequester("",new_string,0)
End
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm