forked from pezy/CppPrimer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# Chapter 10. Generic Algorithms | ||
|
||
##[Exercise 10.1 and 10.2](ex10_1_2.cpp) | ||
##[Exercise 10.1 and 10.2](ex10_01_02.cpp) | ||
##[Exercise 10.3 and 10.4](ex10_03_04.cpp) | ||
##[Exercise 10.5](ex10_05.cpp) |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// | ||
// ex10_05.cpp | ||
// Exercise 10.5 | ||
// | ||
// Created by pezy on 11/9/14. | ||
// Copyright (c) 2014 pezy. All rights reserved. | ||
// | ||
// @Brief In the call to equal on rosters, what would happen if both rosters held C-style strings, rather than library strings? | ||
// @Answer It's the same as `std::string` | ||
|
||
#include <algorithm> | ||
#include <iostream> | ||
#include <vector> | ||
#include <list> | ||
|
||
int main() | ||
{ | ||
std::vector<const char *> roster1{"Mooophy", "pezy", "Queequeg"}; | ||
std::list<const char *> roster2{"Mooophy", "pezy", "Queequeg", "shbling", "evan617"}; | ||
std::cout << std::equal(roster1.cbegin(), roster1.cend(), roster2.cbegin()); | ||
} | ||
|
||
// out | ||
// 1 |