a) An array is a series of elements of the same type in contiguous memory locations
b) An array is a series of element
c) An array is a series of elements of the same type placed in non-contiguous memory locations
d) An array is an element of the different type
Answer: a
Explanation: Correct definition of an array is An array is a series of elements of the same type in contiguous memory locations.
Related Posts
Which function is used to check whether a character is an alphabet?
What we can’t do on a void pointer?
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
int main()
{
int a = 5, c;
void *p = & a;
double b = 3.14;
p = & b;
c = a + b;
cout << c << ‘\n’ << p;
return 0;
}What will be the output of the following C++ code?
#include <iostream>
using namespace std;
int main()
{
int n = 5;
void *p = & n;
int *pi = static_cast< int*>(p);
cout << *pi << endl; return 0; }What will be the output of the following C++ code?
#include <iostream>
using namespace std;
int main()
{
int i;
char c;
void *data;
i = 2;
c = ‘d’;
data = & i;
cout << “the data points to the integer value” << data;
data = & c;
cout << “the data now points to the character” << data;
return 0;
}What will be the output of the following C++ code?
#include <iostream>
using namespace std;
int main()
{
int *p;
void *vp;
if (vp == p);
cout << “equal”;
return 0;
}What will be the output of the following C++ code?
#include <iostream>
using namespace std;
int func(void *Ptr);
int main()
{
char *Str = “abcdefghij”;
func(Str);
return 0;
}
int func(void *Ptr)
{
cout << Ptr;
return 0;
}
Join The Discussion