-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpointer.h
More file actions
32 lines (25 loc) · 1.04 KB
/
pointer.h
File metadata and controls
32 lines (25 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef POINTER_H_
#define POINTER_H_
#include <iostream>
#include <iomanip>
#include <cstring>
#include <fstream>
using namespace std;
//Function Prototype
//This function will prompt the user for a int value and dynamically a create
// a new integer and return a pointer to it.
//Note: This function will be used later to populate both 1d and 2d arrays.
int* createInt(int);
//This function will loop through the entire array, calling createInt()
//Storing the pointer returned from createInt() into the 1d Array.
void populate1D(int *, int);
//This function will loop through the entire array, calling createInt()
//Storing the pointer returned from createInt() into the 2d Array.
void populate2D(int **, int);
//This function will loop through the entire array and print the integer that
// is pointed to by each element (i.e. print the int).
void print1D(int *, int);
//This function will loop through the entire array and print the integer that
// is pointed to by each element (i.e. print the int).
void print2D(int **, int);
#endif /* POINTER_H_ */