0
What is the difference between array and function in c language ,could you tell me the uses difference of both in programs
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/
0
Array: chunk of memory containing data
Function: chunk of memory containing code
- 1
hi