This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

cast a char[] = "" value(s)

hi Forum!

I have declared an char-array, for a simple Data stream buffer of bits:

char data[] = "101101010011111@".

And now just want cast this items to a integer-value. How can i do this in simplest way, without sum the bits bitwise via pointer?

cu
O. Swid

Parents
  • You cannot "cast" an array of characters (or a C string, or an idiosyncratic string format with an '@' on the end). You can convert strings to integers with various functions, as I've mentioned before.

    The C cast operator and syntax will not avail you.

    (... Flame of Udun. And unless you get this assignment right:
    you... SHALL NOT... PASS!)

Reply
  • You cannot "cast" an array of characters (or a C string, or an idiosyncratic string format with an '@' on the end). You can convert strings to integers with various functions, as I've mentioned before.

    The C cast operator and syntax will not avail you.

    (... Flame of Udun. And unless you get this assignment right:
    you... SHALL NOT... PASS!)

Children