Array with functions

May 23, 2011 at 9:15am
closed account (1CohAqkS)
how to create a function that will print array.....
Last edited on May 24, 2011 at 9:22am by admin
May 23, 2011 at 9:24am
closed account (1CohAqkS)
#include <iostream>

int main()
{
const int No_of_marks = 14;
int marks[No_of_marks] = {68, 72, 78, 69, 85, 95, 75, 77, 82, 84, 91, 89, 95, 74};

for (int i =0; i < No_of_marks; ++i)
{
std::cout << "Mark " << i << " = " << marks[i] << std::endl;
}

return 0;
}
May 23, 2011 at 9:25am
closed account (1CohAqkS)
i need to create a function that will print the above declared variables.......plz help!!!!!!!!!!!!!!!!!!!
May 23, 2011 at 9:30am
closed account (1CohAqkS)
jst want to knw how to create a function that will print array............
May 23, 2011 at 9:50am
closed account (z05DSL3A)
First, stop posting in the Articles forum.
Second, Give people some time to respond before begging for help again
Third, look at the threads that you have already had answers to, they clearly show how to pass arrays into functions.

edit:
Requested move to beginners forum.
Last edited on May 23, 2011 at 9:52am
May 24, 2011 at 4:09am
check your email.
Topic archived. No new replies allowed.