Initialize all the elements of array to 0
int myArray[10] = { 0 }; // all elements 0
Initialize all the elements of array to 0
int myArray[10] = { 0 }; // all elements 0
how to initialize an array to value 0 or -1
int arr[10001];
memset(arr,-1,sizeof(arr));
int arr[m][n];
memset(arr,-1,sizeof(arr));
//NOTE:- memset can intialize the array or vector with value -1 or 0 only.
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us