Ask your own question, for FREE!
Computer Science 21 Online
OpenStudy (anonymous):

How are arrays processed? Explain with an example.

OpenStudy (rsmith6559):

Generally, you iterate through the array, processing each element: for( int i = 0; i < array.length(); i++ ) // process array[i];

OpenStudy (anonymous):

they are rows

OpenStudy (anonymous):

Arrays are blocks of similar data. They are processed using a zero based numbering system in most languages. You can either process them by indexing which rsmith6559 has above or you can do it iteratively with what is commonly called a foreach type loop.

OpenStudy (anonymous):

In most C based languages e.g. c++,Java and so on. Arrays are a group of similar data type items. When you want to access a particular item of the array, you have to mention index of the item with array name. Index starts from 0( remember not from 1) and ends at number of items in the array - 1. //Save this as array.c //Compile using, gcc -o array array.c // Run as, ./array #include <stdio.h> int main(int argc, char* argv[]){ char arr[8]; int i; arr[0]='I'; arr[1]='t'; arr[2]=' '; arr[3]='i'; arr[4]='s'; arr[5]=' '; arr[6]='C'; arr[7]='.'; for(i=0;i<8;i++){ printf("%c",arr[i]); } printf("\n"); return 0; } This program should help. For more visit http://that-i-understand.blogspot.com/ . Thanks.

OpenStudy (anonymous):

wow

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!