Skip to content

Comments

1stImplementation#3

Open
Gabriel3970 wants to merge 1 commit intocst438-team13:mainfrom
Gabriel3970:GabeImpl
Open

1stImplementation#3
Gabriel3970 wants to merge 1 commit intocst438-team13:mainfrom
Gabriel3970:GabeImpl

Conversation

@Gabriel3970
Copy link

No description provided.

inFile.open(filename);

// Test for errors.
if (!inFile) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good error checking


cin >> userChoice;

if(userChoice == 1){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be worth separating into its own fn


Post post1;
Post post2;
Post post3;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
Copy link
Contributor

@etkramer etkramer Apr 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor

@etkramer etkramer Apr 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and above could probably be a for loop

Post post2;
Post post3;

bool statement = true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth giving this a more meaningful name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants