c - Can I initialize an array of array with all 0s? -


मेरे पास यह है:

  uint8_t buf [X] [Y];  

मैं सभी तत्वों को 0 से प्रारंभ करना चाहूंगा। यह चाल करेगा:

  uint8_t buf [X] [Y] = {0};  

? यानी यह सभी X * Y तत्वों को 0 से प्रारंभ करेगा?

हाँ यदि आपके पास प्रारंभकर्ता ( {...} ) है, तो स्पष्ट रूप से प्रारंभ नहीं किए गए सभी तत्व शून्य पर आरंभ किए जाएंगे।

संपादित करें: हटाए गए भाग जो सी का उपयोग करते समय सही नहीं है


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -