Open
Conversation
etkramer
reviewed
Apr 23, 2024
| inFile.open(filename); | ||
|
|
||
| // Test for errors. | ||
| if (!inFile) { |
|
|
||
| cin >> userChoice; | ||
|
|
||
| if(userChoice == 1){ |
Contributor
There was a problem hiding this comment.
Could be worth separating into its own fn
|
|
||
| Post post1; | ||
| Post post2; | ||
| Post post3; |
Contributor
There was a problem hiding this comment.
Is this going to work if a test case has 4 (or 2) posts? Storing these in a vector/array would also mean you could use a loop instead of duplicating code later
| cout << "Access Permitted" << endl; | ||
| } | ||
| else{ | ||
| cout << "Access Denied" << endl; |
Contributor
There was a problem hiding this comment.
Will this print "Access Denied" once for every friend that doesn't have the given username?
|
|
||
| //User 3 Friends | ||
| placeHolder[14].erase(remove(placeHolder[14].begin(), placeHolder[14].end(), '['), placeHolder[14].end()); //remove [ from string | ||
| placeHolder[14].erase(remove(placeHolder[14].begin(), placeHolder[14].end(), ']'), placeHolder[14].end()); //remove ] from string |
Contributor
There was a problem hiding this comment.
This and above could probably be a for loop
| Post post2; | ||
| Post post3; | ||
|
|
||
| bool statement = true; |
Contributor
There was a problem hiding this comment.
Might be worth giving this a more meaningful name
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.