Created
September 21, 2015 01:19
-
-
Save christianc1/d32f8e1828d740d450c9 to your computer and use it in GitHub Desktop.
Buddy's Homework 9/20
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
// Buddy's Homework | |
#include <iostream> | |
#include <string> | |
using namespace std; | |
int main() { | |
// Init variable | |
string passCode; | |
// Set variable | |
passCode = "1 " | |
// Standard for loop | |
for( string::iterator i = passCode.begin(); i != passCode.end(); ++i ) { | |
// if this iteration is == to ' ' (a space) | |
if( *i == ' ' ) { | |
// Set this iteration = to an underscore | |
*i = '_'; | |
} | |
} | |
// output the new passcode | |
cout << passCode << endl; | |
// return 0 | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment