How to read uint8_t data type from command line input
Hi All,
Here is my simple program
Code:
#include<iostream>
using namespace std;
int main()
{
uint8_t sa[6];
cout<<"enter addr"<<endl;
for(int i=0;i<6;i++)
cin>>sa[i];
for(int i=0;i<6;i++)
cout<<"Address sa["<<i<<"]"<<sa[i]<<endl;
system("pause");
return 0;
}
when i input values from console
12
21
21
22
my array should read
sa[0] 12
sa[1] 21
but instead
it reads
sa[0] 1
sa[1] 2
how can I have these values entered or modify my program to make my sa[0] to have 12 and not a single element
please help me with this
I want to use uint8_t data type only
Thanks to all for reading this post.
Looking forward to your help.