C++ without using functions from C standard library #include #include #include
int main(int argc, char *argv[]) { std::string str; str = "Hello World!"; int count = 10; if (argc > 1) { std::string strargv1 = std::string(argv[1]); count = std::stoi(strargv1); } for (int i = 0; i < count; i++) std::cout
Luke Jackson
it's more powerful xDD
Connor Jackson
C# is better than both.
James Torres
t. pajeet
Asher Gonzalez
If all you're doing is absurdly simple console IO, then yes.
Kayden Bell
using namespace std;
Carson Gray
t. old faggot
Noah Kelly
>2016 >using a DESIGNATED language
Owen Diaz
>Hello World comparison
it doesn't matter
your opinion and input on the subject matter are completely irrelevant as you know literally fuck-all about either language, and most likely programming in general
Sebastian Flores
C is for largely embedded systems nowadays writing much of anything else is quite a bit more tedious
C++ is utilized in a much wider range, but for example web development it isn't any good for
C# is good as a back-end systems language, among other things however the accompanying overhead of a framework and virtual machine don't always make it a good choice
tl;dr each language has its uses and trivial syntax length comparisons only show that you're a retarded clueless fizzbuzz engineer
Connor Bell
>Deliberately writing code like a retard to make an invalid point about the brevity of a language.
The only substantial difference that you didn't artificially introduce yourself is iostreams, which despite being verbose comes with memory safety guarantees printf doesn't have. Otherwise all you did was write the same thing twice while introducing a bunch of unnecessary temporary variables in the C++ side.
Juan Green
>but for example web development it isn't any good for Except C++ is literally the best language for the web.
Brody Lopez
The c++ example is more readable though.
Jonathan Brown
#include #include #include
int main(int argc, char *argv[]) { using namespace std; string str = "Hello World!"; int count = 10; if (argc > 1) count = stoi(string(argv[1])); for (int i = 0; i < count; i++) cout
Aiden Allen
auto str = "hello world"
Juan Cox
that doesn't yield a std::string, unless you append s to the end (C++17 only?)
Liam Wright
So c++ has a stoi function but doesn't have a proper toString one? (no boost doesn't count).
Elijah Jones
>(C++17 only?) >? this is partly why C++ is so horrible
Charles White
std::to_string()
Austin Taylor
Wow this trivial example BTFOs C++ for good.
Mason Garcia
Lambdas
Jason Campbell
>C++ is horrible because it's still getting regular updates kill yourself as soon as possible
Jason Powell
I knew about that, but it's only C++11 and later.
Jose Ortiz
yes and?
Jacob Ramirez
#include #include #include
int main(int argc, char *argv[]) { std::string str ("Hello World!"); int count; if (argc == 1) { count = 10; } else if (argc == 2) { std::istringstream iss (argv[1]); iss >> count; if (iss.fail () || !iss.eof ()) { std::cerr