Hello everybody.
This is a code , char to Ascii
#include <stdio.h>
#include <conio.h>
main()
{
char c;
int a;
printf("Enter charater:",c);
scanf("%c",&c);
printf("%d",c);
getch();
}
Example :
Enter a character :
a Result :
97And this is a code ,string to several Ascii
#include <iostream.h>
#include <conio.h>
#include <string.h>
void main()
{
char *str1;
char st[80];
do
{
str1=st;
cin.get(st,80);
while(*str1)
cout<<int(*str1++)<<" ";
}
while(strcmp(st,"done")==0);
getch();
}
Example : Enter a string
Hello abcdResult :
72 101 108 111 32 97 98 99 100These codes run good with Visual C++6.0 but not run in Arduino ,
can you help me modify them.Thanks a lots.