Skip to main content
2 of 3
added 139 characters in body
ocrdu
  • 1.8k
  • 3
  • 12
  • 24

Not sure if or why you want to convert char* to int, but if you need to, there are atoi(), atol(), strtol(), strtoul() to consider, or rolling your own function.

Pros and cons are discussed here. Main thing to note is that atoi() and atol() have no error handling.

BTW I would try to get the websocket to send the correct single bytes instead of string representations of numbers, if at all possible.

ocrdu
  • 1.8k
  • 3
  • 12
  • 24