0

What is the difference between array and function in c language ,could you tell me the uses difference of both in programs

25th Oct 2019, 12:50 PM
Ishitha
3 ответов
+ 2
Array use to store information: lets say you want to load the pictures for an image gallery on your website well you could store the image filenames in an array like this:- var images = ['image1.jpg', 'image2.jpg', 'image3.jpg']; A function performs an action, in the function below , a for loop is used to display each array item in the console. var images = ['image1.jpg','image2.jpg','image3.jpg']; function displayImageNames(images) { for(var i = 0; i < images.length; i++ { console.log(images[i]); } } displayImageNames(images); Array in C https://www.javatpoint.com/c-array function in C https://www.google.com/amp/s/www.geeksforgeeks.org/functions-in-c/amp/
25th Oct 2019, 12:59 PM
A͢J
A͢J - avatar
0
Array: chunk of memory containing data Function: chunk of memory containing code
25th Oct 2019, 4:37 PM
Bilbo Baggins
Bilbo Baggins - avatar
- 1
hi
16th Nov 2020, 2:06 PM
sanu parjapati
sanu parjapati - avatar