Skip to content

Commit fe47f77

Browse files
committed
Fix typos in cpp modules
1 parent 2d12f0d commit fe47f77

5 files changed

Lines changed: 8 additions & 8 deletions

File tree

cpp/cpp1/animals.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ class Animal {
1010
public:
1111
Animal(string s="Noname") : name(s) { } // Default value = "Noname"
1212

13-
// Pure virtual method - must be overridden by non-abstract derrived class
13+
// Pure virtual method - must be overridden by non-abstract derived class
1414
virtual void speak() = 0;
1515

1616
// Virtual method - can be overridden by the child class. The type of the
1717
// *OBJECT* being pointed to determines the method that gets called.
1818
virtual void move() { cout << " ANIMAL " << name << " : I'm moving" << endl; }
1919

20-
// Non-virtual method - can be overriddedn by the child class. The type
20+
// Non-virtual method - can be overridden by the child class. The type
2121
// of the *POINTER* being used determines the method that gets called.
2222
void eat() { cout << " ANIMAL " << name << " : I'm hungry!" << endl; }
2323
};

cpp/cpp1/boolean.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ int main() {
3434

3535
cout << endl;
3636

37-
// Loop until we reach a multiple 7 larget than 10;
37+
// Loop until we reach a multiple 7 larger than 10;
3838
int ii=0;
3939
bool multOf7 = false;
4040
bool bigger10 = false;
@@ -52,7 +52,7 @@ int main() {
5252
}
5353

5454
cout << endl;
55-
// Loop until we reach a multiple 5 larget than 16
55+
// Loop until we reach a multiple 5 larger than 16
5656
int jj=0;
5757
while (!finished) {
5858
cout << jj << " ";

cpp/cpp1/cppio.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ int main() {
88
std::cin >> count;
99

1010
std::cout << "Enter a word: ";
11-
std::cin >> str; // cin only gets chararcter until the next whitespace
11+
std::cin >> str; // cin only gets character until the next whitespace
1212

1313
for(int ii=0; ii<count; ii++) {
1414
std::cout << ii+1 << " : " << str << std::endl;

cpp/cpp1/overview.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ int main() {
1818
cout << "d = " << d << endl;
1919
cout << endl;
2020

21-
// Automatic types - deduced from the initalizer
21+
// Automatic types - deduced from the initializer
2222
auto m = 3;
2323
auto n = 3.14;
2424
auto o = 'x';

cpp/cpp3/vectors.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ template<typename T> void printVector(vector<T> vec, const string name);
88

99
int main() {
1010
vector<int> v1(10); // Create a vector with a capacity of 10
11-
vector<int> v2 = {10, 20, 30}; // Initialize with an array initalizer
11+
vector<int> v2 = {10, 20, 30}; // Initialize with an array initializer
1212
vector<int> v3; // Default initialization
1313
vector<int> v4 = {8, 3, 1, 5, 12, 13, 2, 7, 10};
1414
vector<int>::size_type vsize; // size_type is an unsigned type that stores a size
@@ -108,7 +108,7 @@ int main() {
108108
printVector(v3, "v3");
109109

110110

111-
cout << endl << "Calling push_back on a vector with a defined capactity " << endl;
111+
cout << endl << "Calling push_back on a vector with a defined capacity " << endl;
112112
for (int ii=0;ii<10;ii++) {
113113
v1.push_back(ii+10);
114114
}

0 commit comments

Comments
 (0)