Home
Recent Q&A
Java
Cloud
JavaScript
Python
SQL
PHP
HTML
C++
Data Science
DBMS
Devops
Hadoop
Machine Learning
Azure
Blockchain
Devops
Ask a Question
Why is it necessary to give the size of an array in an array declaration in C Language?
Home
C Plus Plus
Why is it necessary to give the size of an array in an array declaration in C Language?
asked
Mar 17, 2020
in
C Plus Plus
by
rajeshsharma
(
23.9k
points)
Why is it necessary to give the size of an array in an array declaration in C Language?
#c-language-array-of-array
Please
log in
or
register
to answer this question.
1
Answer
0
votes
answered
Mar 17, 2020
by
Robindeniel
(
20.8k
points)
When an array is declared, the compiler allocates a base address and reserves enough space
in
memory for all the elements of the array. The size is required to allocate the required space and
hence size must be mentioned.
Related questions
0
votes
Q: Is it possible to have negative index in an array in C Language?
asked
Mar 17, 2020
in
C Plus Plus
by
rajeshsharma
(
23.9k
points)
#c-language-negative-index
+2
votes
Q: Select the best from following can be considered as the correct syntax for declaring an array of pointers of integers that has a size of 10 in C++?
asked
Jan 21, 2021
in
C Plus Plus
by
SakshiSharma
(
32.2k
points)
#array
array-size
0
votes
Q: Can the size of an array be increased after declaration?
asked
Oct 13, 2020
in
JAVA
by
SakshiSharma
(
32.2k
points)
#size-of-an-array-
array-size
Java-questions-answers
+2
votes
Q: Which type of memory is used by an Array in C++ programming language?
asked
Jan 21, 2021
in
C Plus Plus
by
SakshiSharma
(
32.2k
points)
#c
-array
#array
0
votes
Q: What is an array of pointers in C Language?
asked
Mar 17, 2020
in
C Plus Plus
by
rajeshsharma
(
23.9k
points)
#c-language-array-pointer
0
votes
Q: Are the expressions arr and &arr same for an array of integers in C Language?
asked
Mar 12, 2020
in
C Plus Plus
by
rahuljain1
(
6.5k
points)
#c-language-expressions
+1
vote
Q: In C, why is the void pointer useful in C Language? When would you use it in C Language?
asked
Mar 12, 2020
in
C Plus Plus
by
rahuljain1
(
6.5k
points)
#c-language-void-pointer
+2
votes
Q: How many types of the array are there in the C++ programming language?
asked
Jan 21, 2021
in
C Plus Plus
by
SakshiSharma
(
32.2k
points)
#c-array
array
0
votes
Q: What is a NULL Pointer in C Language? Whether it is same as an uninitialized pointer in C Language?
asked
Mar 12, 2020
in
C Plus Plus
by
rahuljain1
(
6.5k
points)
#c-language-null-pointer
0
votes
Q: What is the use of ‘using' declaration in C++
asked
Jun 11, 2020
in
C Plus Plus
by
Robindeniel
(
20.8k
points)
#c
-declaration
#declaration-c
+1
vote
Q: C++ 14 Feature- Alternate type deduction on declaration
asked
Jan 4, 2020
in
C Plus Plus
by
AdilsonLima
(
6.4k
points)
0
votes
Q: Out of fgets() and gets() which function is safe to use and why in C Language?
asked
Mar 10, 2020
in
C Plus Plus
by
rahuljain1
(
6.5k
points)
#c-language-fgets
#c-language-gets
0
votes
Q: Why is not necessary to use entryComponents array every time?
asked
Sep 22
in
Angular
by
DavidAnderson
(
9.0k
points)
angularjs-interview-questions-answers
0
votes
Q: How do I find the length of an array in C/C-PlusPlus
asked
Nov 24, 2020
in
C Plus Plus
by
sharadyadav1986
(
31.7k
points)
#array-length
#length-of-array
0
votes
Q: What is a far pointer in C Language? Where we use it in C Language?
asked
Mar 12, 2020
in
C Plus Plus
by
rahuljain1
(
6.5k
points)
#c-language-pointer
...