0

In character array we can write

char ZEROARRAY[1024] = {0};

but how do we initialize zero value in integer array.

1
  • char is an integer type in C++. The syntax is the same for all integer types as well (short, long, wchar_t, ...). Commented Sep 4, 2014 at 12:34

2 Answers 2

2

It's similar:

int ZEROARRAY[1024] = {0};

or even simpler:

int ZEROARRAY[1024] = {};
Sign up to request clarification or add additional context in comments.

Comments

1

Exactly same way

int zeroarray[1024] = {0};

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.