Fundamentals
Strings
#include <string.h> std::string digest(std::string param) { std::string result; for (int i = 0; i < param.size() - 1; i++) { result += param[i]; result += ' '; } result += param[param.size() - 1]; return result; } //Please fix!
- #include <string.h>
- std::string digest(std::string param) {
- std::string result;
for (int i = 0; sizeof(param); i++) {- for (int i = 0; i < param.size() - 1; i++) {
- result += param[i];
- result += ' ';
- }
- result += param[param.size() - 1];
- return result;
- } //Please fix!