That's my C code. I'm trying to store values in my arrays using the for-loop but nothing is stored and only the value of the variable trackingCodes changes. I don't where the errors comes from . No compiling errors
#include <stdio.h>
int main(void) {
int trackingCodes = 0;
char typeCode[trackingCodes];
int codeLength [trackingCodes];
int byteChar = 0;
int byteInt = 0;
int byteDouble = 0;
int j = 0;
int totalBytes = 0;
int totalByteDouble = 0;
int totalByteInt = 0;
int totalByteChar = 0;
scanf("%d", &trackingCodes);
for ( j = 0; j < trackingCodes; j++)
{
scanf("%d %c", &codeLength[j], &typeCode[j]);
if (typeCode[j] == 'c')
{
byteChar = codeLength[j] * sizeof(char);
totalByteChar = totalByteChar + byteChar;
}
else if (typeCode[j] == 'i')
{
byteInt = codeLength[j] * sizeof(int);
totalByteInt = totalByteInt + byteInt;
}
else if (typeCode[j] == 'd')
{
byteDouble = codeLength[j] * sizeof(double);
totalByteDouble = totalByteDouble + byteDouble;
}
}
totalBytes = totalByteChar + totalByteDouble + totalByteInt;
int t = 0;
for(t = 0; t < trackingCodes; t++){
if(codeLength[t] != 'i' && codeLength[t] != 'c' && codeLength[t] != 'd'){
printf("Invalid Tracking code type");
return 0;
}
}
printf("%d bytes\n", totalBytes);
return 0;
}```