Q:

Conversion of decimal to string

I'm trying to convert a decimal value into a string. I use the STM32CubeIDE IDE but am getting an error like 'Invalid binary operator'. I'm able to set &n to the decimal value 3695.  I need to convert that into a string. How would I do that?
void main() 
{

    uint8_t TxArr;
    uint16_t Data;
    int a[10];
    int i;
   while (1)
   {
     HAL_I2C_Master_Transmit(&hi2c1,0x16, &TxArr, 1, 1000);
     HAL_I2C_Master_Receive(&hi2c1, 0x17, &Data, 2, 1000);
     for(i=0;i<4;i++)
      {
      a[i]=Data%10+0x30;     //value in Data is 3695.
      Data=Data/10;
      HAL_UART_Transmit(&huart3, a[i], 11, 100);
      HAL_Delay(300);
      }

      }

A:

The error is produced by:
n = n / 10;

What this would do if n was a pointer (int* n) is that it would repoint n to a location one tenth the original number. You will need to begin using normal array operators if you want your code to work properly.
The second problem you have is the following:
You declare n as a array of 10 integers of type and with int.
int n[10];

Then in your for loop you try to do this:
n > 0; 

This is an invalid operation as n wil decay into a pointer and as such the address of your array is compared to 0. This will always evaluate as TRUE!
A good way to convert a integer to a string (char array) is this answer.
In your sitaution that would be 
int yourToBeConvertedNumber;
char str[INT_MAX]; // or any other reasonable upper bound you have set for the input data.
snprintf(str, sizeof(str), "%d", yourToBeConvertedNumber);

