Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - How does c language convert int array into string?
How does c language convert int array into string?
Method 1:

int a[ 10]={ 1,2,3,4,5,6,7,8,9,0 };

char buf[ 10];

String s;

for(int I = 0; I< 10; i++)

{

itoa(a[i],buf, 10);

s+= buf;

}

Method 2:

int a[ 10]={65,66,67,68,69,70,7 1,72,73,74 };

char buf

String s;

for(int I = 0; I< 10; i++)

{

buf = a[I];

s+= buf;

}

Method 3:

int a[ 10]={0, 1,2,3,4,5,6,7,8,9 };

char buf

String s;

for(int I = 0; I< 10; i++)

{

buf =(char)a[I]+48;

s+= buf;

}