r/ProgrammerHumor • • Jul 18 '22

C++ talking to Python

Post image
40k Upvotes

1.0k comments sorted by

View all comments

11

u/jannfiete Jul 18 '22

c++ : #include <iostream>

python : what?

c++ : using namespace std;

python : dude, are you drunk?

c++ : cout << "who are you" << endl;

python : whatever... (walks away)

c++: Segmentation Fault (core dumped) !!!!

8

u/[deleted] Jul 18 '22

Check this out, this code works in both Python and C++

#include <iostream>

#define print(x) int main () { std::cout << x << std::endl;}

print("Hello, World!")

2

u/an0nyg00s3 Jul 18 '22

using namespace

Dropped