「✨」 feat(Megaphone): Finished megaphone
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user