Which of the following is a valid initialization for the variable size when declaring the following array:
int test_array[size];
Group of answer choices
int size = 12;
double size = 12;
const int size = 12;
int size = 0;
we cannot create a array of size double, the type of the size should always be int, it can be const int , int of size 0 as well.
so the answer is option A,C,D
#include <bits/stdc++.h>
using namespace std;
int main()
{
int size1 = 12;
double size2 = 12;
const int size3 = 12;
int size4 = 0;
int a[size1];
int b[size2];
int c[size3];
int d[size4];
return 0;
}
output:
Get Answers For Free
Most questions answered within 1 hours.