What do you want to save?
Add Code snippet
New code examples
-
Other 2021-09-26 21:22:03
what is the need of memset funtion
#include <stdio.h> #include <string.h> #define LEN 10 int main(void) { char arr[LEN]; int loop; printf("Array elements are (before memset()): \n"); for(loop=0; loop<LEN; loop++) printf("%d ",arr[loop]); printf(&... Add solution -
Java 2021-09-26 10:59:05
how to loop through an array
var data = [1, 2, 3, 4, 5, 6]; // traditional for loop for(let i=0; i<=data.length; i++) { console.log(data[i]) // 1 2 3 4 5 6 } // using for...of for(let i of data) { console.log(i) // 1 2 3 4 5 6 } // using for...in for(let i in data) { con... Add solution -
Javascript 2021-09-25 17:28:05
access to nested properties on javascript using property names
const getNestedObject = (nestedObj, pathArr) => { return pathArr.reduce((obj, key) => (obj && obj[key] !== 'undefined') ? obj[key] : undefined, nestedObj); } // pass in your object structure as array elements const name = getNes... Add solution -
Javascript 2021-09-25 09:29:03
loop through javascript array
var data = [1, 2, 3, 4, 5, 6]; // traditional for loop for(let i=0; i<=data.length; i++) { console.log(data[i]) // 1 2 3 4 5 6 } // using for...of for(let i of data) { console.log(i) // 1 2 3 4 5 6 } // using for...in for(let i in data) { con... Add solution -
Python 2021-09-24 18:46:03
numpy array storing in file by python
# long arrays can be stored in csv files far more efficiently import numpy as np import csv # uploading arrays in a csv file arr1 = [i for i in range(500)] arr2 = [i for i in range(1000)] arr3 = [i for i in range(2000)] # you can write('w') or append('a'... Add solution -
Other 2021-09-15 18:20:03
why does array index start from 0
An array arr[i] is interpreted as *(arr+i). Here, arr denotes the address of the first array element or the 0 index element. So *(arr+i) means the element at i distance from the first element of the array. So array index starts from 0 as initially i is 0 ... Add solution
Best helpers
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5