Hi everyone - I was reading the ctypes tutorial, and I came across this:
s = "Hello, World"
c_s = c_char_p(s)
print c_s
c_s.value = "Hi, there"
But I had been using pointers like this:
s = "Hello, World!"
c_s = c_char_p()
c_s = s
print c_s
c_s.value
Traceback (most recent call last):
File "<pyshell#17>", line 1, in <module>
c_s.value
AttributeError: 'str' object has no attribute 'value'
Why is it that when I do it one way, I can access c_s.value, and when I do it the other way, there is no value object?
Thanks all!