DEV Community

Discussion on: Meme Monday 🌻

Collapse
 
wiseai profile image
Mahmoud Harmouch • Edited

It is the same thing. Don't stress me, please!

  • Python
def main() -> int:
  print("Hello World!")
  return 0
main()
Enter fullscreen mode Exit fullscreen mode
  • C++
#include <cstdio>
int main(void) {
 printf("Hello World!\n");
 return 0;
}
Enter fullscreen mode Exit fullscreen mode

Edit: I know that, in python, you can just type print("Hello World!"). But, I don't think that would constitute a fair comparison, know what I am sayin'? I also know about cstdio vs iostream vs std namespace.

Collapse
 
chiki1601 profile image
Miss Pooja Anilkumar Patel

wow, nice explanation!

Collapse
 
flavius_the_0th profile image
Flavius

hello world in bf: 💀

Collapse
 
posandu profile image
Posandu

2nd one is C right?

Thread Thread
 
wiseai profile image
Mahmoud Harmouch

Well yes, but actually no. printf is a c function, but you can use it in c++ by importing the cstdio c header file. So, it is a valid c++ program using c functions.

c++

Thread Thread
 
posandu profile image
Posandu

Oh. Thanks for the explanation!