-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnnArray.cpp
More file actions
38 lines (30 loc) · 770 Bytes
/
nnArray.cpp
File metadata and controls
38 lines (30 loc) · 770 Bytes
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
33
34
35
36
37
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: nnArray.cpp
* Author: homayoun
*
* Created on November 22, 2016, 11:50 AM
*/
#include "nnArray.h"
nnArray::nnArray() : intArray() {
}
nnArray(int _size, int content) : intArray() {
if (content >= 0) {
setSize(_size);
allocData(_size);
for (int i = 0; i < _size; i++) {
setData(i, content)
}
} else {
cout << "Natural numbers can't be negative." << endl;
cout << "The default constructor has been invoked." << endl;
}
}
nnArray::nnArray(const nnArray& orig) {
}
nnArray::~nnArray() {
}