Home AMX User Forum NetLinx Studio

quick questions about char arrays

can I do this ?

char temp[]='12345'
integer num

num=atoi(temp[2])

In the end this is what im looking for num=2

Comments

  • Joe HebertJoe Hebert Posts: 2,159
    Yes you can but you need to use double quotes like this:

    num=atoi("temp[2]")
    letMeIn wrote:
    can I do this ?

    char temp[]='12345'
    integer num

    num=atoi(temp[2])

    In the end this is what im looking for num=2
  • letMeInletMeIn Posts: 15
    sweet thanks for your help.
Sign In or Register to comment.