Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- #include <conio.h>
- using namespace std;
- void printArray(char** ptrName, int* ptrAge)
- {
- for(int i = 0; i < 3; i++)
- {
- cout << ptrAge[i] << " - " << *(ptrName + i) << endl;
- }
- }
- int main()
- {
- char* names[3] = {"Nikita", "Vlad", "Ivan"};
- int ages[3] = {19, 18, 20};
- char** ptrName = &names[0];
- int* ptrAge = &ages[0];
- printArray(ptrName, ptrAge);
- _getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment