Skip to content

Commit

Permalink
Add toupper() function
Browse files Browse the repository at this point in the history
  • Loading branch information
maximecb committed Nov 10, 2023
1 parent 921cb53 commit 29c26cf
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ncc/include/ctype.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,14 @@ int isupper(int c)
return (c >= 'A' && c <= 'Z');
}

int toupper(int ch)
{
if (islower(ch))
{
return ch + ('A' - 'a');
}

return ch;
}

#endif

0 comments on commit 29c26cf

Please sign in to comment.