Author Topic: Pointer woes  (Read 1487 times)

0 Members and 1 Guest are viewing this topic.

  • Guest
Pointer woes
« on: October 09, 2018, 04:08:07 PM »
This code prints the entire string:

Code: [Select]
wchar w[11] = "1234567890"
print w[1]

How to print each individual character?
« Last Edit: October 09, 2018, 04:28:29 PM by José Roca »

JRS

  • Guest
Re: Pointer woes
« Reply #1 on: October 09, 2018, 04:34:23 PM »
It feels like you're sanitizing O2 syntax.  ;D

Charles Pegge

  • Guest
Re: Pointer woes
« Reply #2 on: October 09, 2018, 04:48:40 PM »
You can overlay any string with a byte or word array. It is much more efficient than using asc or mid to get individual characters

Code: [Select]
byte b at strptr w
print b[1]