42_CPP00/ex00/megaphone.cpp

23 lines
466 B
C++
Raw Normal View History

2023-05-17 12:41:46 -04:00
#include <iostream>
#include <string>
#include <cctype>
int main(int argc, char *argv[]) {
if (argc < 2) {
std::cout << "* LOUD AND UNBEARABLE FEEDBACK NOISE *" << std::endl;
return 0;
}
std::string message;
for (int i = 1; i < argc; i++) {
message += argv[i];
}
for (int i = 0; message[i] != '\0'; i++) {
message[i] = std::toupper(message[i]);
}
std::cout << message << std::endl;
return 0;
}