main.cpp - #include <iostream> using namespace std void test(int*ptr int n int main int num[5 for(int j=1 j<5 j num[j = 10 j test(num 5 for(int j = 0 j

main.cpp - #include <iostream> using namespace std void...

This preview shows page 1 out of 1 page.

#include <iostream> using namespace std; void test(int *ptr, int n); int main() { int num[5]; for (int j=1; j<5; j++) num[j] = 10 * j; test(num, 5); for (int j = 0; j < 5; j++) cout << "num[" << j<<"] is " << num[j] << "\t" << &num[j] << endl;
Image of page 1

You've reached the end of your free preview.

Want to read the whole page?

  • Spring '17
  • Return statement, Void type, Carriage return, void test

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes