How to convert a char array into an int in C++?

How do you convert a long int into a char?

  • im using an arduino uno. Im making a project about sending a long int data by using a transmitter and im using the virtualwire for it. virtualwire can only send chars and nothing ...show more

  • Answer:

    Use mask and shift... long i; char c; int j; .... for(j=0;j<4;j++){... c= i &255;// or c = i & 0XFF; i=i>>8; }

DJAJY73FROGL7CMCGQ7URNKHRU at Yahoo! Answers Visit the source

Was this solution helpful to you?

Other answers

d

Islam

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.