1
0

」 feat(Megaphone): Finished megaphone

This commit is contained in:
2024-10-25 23:24:09 +02:00
parent 5b36260025
commit b345d058f8
3 changed files with 29 additions and 3 deletions

View File

@ -6,15 +6,39 @@
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/25 16:31:50 by adjoly #+# #+# */
/* Updated: 2024/10/25 16:54:55 by adjoly ### ########.fr */
/* Updated: 2024/10/25 17:47:40 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
#include <cctype>
#include <iostream>
#include <string>
void str_to_upper(std::string &str)
{
char *ptr = (char *)str.c_str();
while (*ptr)
{
*ptr = std::toupper(*ptr);
ptr++;
}
}
int main(int ac, char **av)
{
std::string str;
(void)av;
if (ac < 2)
std::cout << "* LOUD AND UNBEARABLE FEEDBACK NOISE *" << std::endl;
else
{
while (++av && *av)
str.append(*av);
str_to_upper(str);
std::cout << str << std::endl;
}
return (0);
}