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?
0
votes
asked
Mar 17, 2020
in
C Plus Plus
by
rajeshsharma
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
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.
Your comment on this answer:
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
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
#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
#array
array-size
0
votes
Q: Can the size of an array be increased after declaration?
asked
Oct 13, 2020
in
JAVA
by
SakshiSharma
#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
#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
#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
#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
#c-language-void-pointer
0
votes
Q: Can you walk through the steps of creating an Armadillo-based C++ project, linking the necessary libraries?
asked
Nov 19, 2023
in
C Plus Plus
by
GeorgeBell
armadillo-interview-questions-answers
+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
#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
#c-language-null-pointer
...