A community for students.

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

anonymous

  • 5 years ago

How are arrays processed? Explain with an example.

  • This Question is Closed
  1. rsmith6559
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

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

  2. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    they are rows

  3. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    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.

  4. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    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.

  5. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    wow

  6. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.