Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 8ca7607

Browse files
Update logic flow in main to loop until user enters a valid string of uppercase letters
1 parent 47ca13e commit 8ca7607

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

‎Source.c‎

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ int main(void) {
2929

3030
/* Get user string of uppercase letters */
3131
char s2[S2LENGTHMAX];
32-
generateS2(s2);
32+
33+
do {
34+
generateS2(s2); /* Loop until we have a valid string */
35+
} while (s2[0] == '0円');
3336

3437
/* Get replacement character from user */
3538
char ch = getReplacementCharacter();
@@ -198,4 +201,17 @@ void duplicateArray(char s1[S1LENGTH + 1], char s3[S1LENGTH + 1]) {
198201
for (int i = 0; i < S1LENGTH + 1; ++i) {
199202
s3[i] = s1[i];
200203
}
201-
}
204+
}
205+
206+
/* TEST CASE */
207+
/*
208+
209+
210+
211+
212+
213+
214+
215+
216+
217+
*/

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /