Initializing array below is same as initializing variables in cpp language

using namespace std;
int main(){
    int a[0];

if i donot take input it prints garbage value? why compiler do not throw error on declaring array having size zero?

Read more here:

Content Attribution

This content was originally published by Muneeb Aslam at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: