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 have already been given the means to covert an array of binary digit characters in this thread:

    http://www.keil.com/forum/docs/thread4249.asp

    Since you are asking again, one can only assume that the answers given there were inadequate. To be of further assistance, you'll need to tell us what there was about the previous answers that did not suit your requirements.

    "And now just want cast this items to a integer-value."

    Your use of "cast" here in a C forum is quite confusing, since "cast" has a specific meaning and use in the C language that is entirely incompatible with your apparent intentions. Would we better understand you to mean "convert"?

    "...without sum the bits bitwise via pointer?"

    I don't understand this requirement at all. Could you please restate your root requirement in a different way?

Reply
  • You have already been given the means to covert an array of binary digit characters in this thread:

    http://www.keil.com/forum/docs/thread4249.asp

    Since you are asking again, one can only assume that the answers given there were inadequate. To be of further assistance, you'll need to tell us what there was about the previous answers that did not suit your requirements.

    "And now just want cast this items to a integer-value."

    Your use of "cast" here in a C forum is quite confusing, since "cast" has a specific meaning and use in the C language that is entirely incompatible with your apparent intentions. Would we better understand you to mean "convert"?

    "...without sum the bits bitwise via pointer?"

    I don't understand this requirement at all. Could you please restate your root requirement in a different way?

Children