The past few days I've been experimenting with Cython and I have a quick questions regarding the way c / cython handles strings as character arrays / pointers:
def function(char *string):
for i in xrange(len(string)):
print string[i]
print &string[i]
Now for example, when I compile and run the code, with "abc" as an argument, I get the following answer:
97
abc
98
bc
99
c
Now my questions are:
- Why does cython print out the ascii value for each character in
string[i]? - Why does cython print out the suffix of the string starting at index
iin&string[i]?
Thank you very much.
str, notchar *.