Im trying to like append the correct values inside of temperatures_cval but i dont get the result i would expect? dont know how to fix it tried also const int*
#include <stdio.h>
constexpr int no_value = -999;
constexpr int temperatures[]{ 10, 12, no_value, no_value, 20, 14, 6, -1, -5, 0, no_value, 1, -3 };
constexpr int size = sizeof(temperatures) / sizeof(int);
int temperatures_cval[size];
void without_no_value(const int array[], int size)
{
int temp = temperatures[0];
if (temperatures[0] == no_value)
{
temp = 0;
}
for (int i = 0; (i = size); i++)
{
if (temperatures[i] == no_value)
{
temperatures_cval[i] = temp;
}else
{
temperatures_cval[i] = temperatures[i];
temp = temperatures[i];
}
}
}
int main(){
without_no_value(temperatures, size);
for (int i = 0; (i = size); i++){
printf("%i", temperatures_cval[i]);
}
}