diff --git a/README.md b/README.md index ec9560d..7f76a34 100644 --- a/README.md +++ b/README.md @@ -1 +1,11 @@ -# CSCI136part2 \ No newline at end of file +# CSCI136part2 +## Forked by Anthony +### Observations Here +### Commented in code + +1. Has uses namespace std, MZ disapproves. +2. File funcs.cpp consists of removeLeadingSpaces and countChar. +3. Tried to stream input from text file. Unsucessful in current iteration. +4. Does not contain unindent or indent functions. +5. Functions work. +6. Added unindent and indent functions. \ No newline at end of file diff --git a/lab_08/funcs.cpp b/lab_08/funcs.cpp index 186a7b8..da6bc68 100644 --- a/lab_08/funcs.cpp +++ b/lab_08/funcs.cpp @@ -1,19 +1,29 @@ #include #include +//using a namespace using namespace std; - string removeLeadingSpaces(string line){ + + //counter int i=0; + + //while loop to find first !space while(isspace(line[i])){ i++; } + + //returns line without leading spaces return line.substr(i,line.length()-i); } int countChar(string line, char c){ + + //counter int o = 0; + + //for loops to find matches to c, adding to o every time matched for(int i=0; i