style: doing the more cpp style possible
This commit is contained in:
parent
c5144c9d77
commit
5ab3c6d741
1 changed files with 4 additions and 8 deletions
|
|
@ -6,17 +6,18 @@
|
||||||
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/08/06 16:08:46 by rparodi #+# #+# */
|
/* Created: 2024/08/06 16:08:46 by rparodi #+# #+# */
|
||||||
/* Updated: 2024/09/03 18:22:21 by rparodi ### ########.fr */
|
/* Updated: 2024/12/17 22:45:02 by rparodi ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
std::string str_toupper(std::string str)
|
std::string str_toupper(std::string str)
|
||||||
{
|
{
|
||||||
for (size_t i = 0; str[i] != '\0'; i++)
|
for (size_t i = 0; i < str.length(); i++)
|
||||||
str[i] = std::toupper(str[i]);
|
str[i] = std::toupper(str[i]);
|
||||||
return (str);
|
return (str);
|
||||||
}
|
}
|
||||||
|
|
@ -24,13 +25,8 @@ std::string str_toupper(std::string str)
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
if (argc > 1)
|
if (argc > 1)
|
||||||
{
|
for (int i = 1; i < argc; i++)
|
||||||
for (int i = 1; i < argc; i++){
|
|
||||||
std::cout << str_toupper(argv[i]);
|
std::cout << str_toupper(argv[i]);
|
||||||
if (i + 1 != argc)
|
|
||||||
std::cout << " ";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
std::cout << "* LOUD AND UNBEARABLE FEEDBACK NOISE *";
|
std::cout << "* LOUD AND UNBEARABLE FEEDBACK NOISE *";
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue