221

Friend : Hey bro I made an awesome program which shows your future wife's name.

Me : Hey that sounds interesting, show me the source code bro !!

Friend shows the code :

#include <bits/stdc++.h>
using namespace std;

int main()
{
string first_name , last_name;

cout << "Enter your first name\n";
cin >> first_name ;

cout << "Enter your last name\n";
cin >> last_name ;

cout << "Your wife's name is " << "Mrs " << last_name << "\n";

}

Me : Dude you are gonna crack Google some day :P

Comments
  • 22
    At least he used /n rather than std::endl.
  • 11
    @meladath what's bad in std::endl? That it flushes the stream?
  • 6
    I think he was kidding
  • 5
    It's a cin to put it in, a flush() to pull it out
  • 3
  • 4
    @7Raiden Exactly. It'd be fine here, but it's a bad habit and can make things rather slow
  • 1
    He is right you know :D
  • 2
    God Damn I laugh soooo hard at this
  • 3
    that first curly bracket looks sooooo lost.... and sad... and cold... and lonely
  • 12
    Ported to JS... couldn't resist a round of code golf 😝

    alert(`Your future wifes name is Mrs ${['first','last'].map(a=>prompt(`Enter your ${a} name`))[1]}`)
  • 2
    @someonewithpc Well, depending what you're doing :) I never had slow down using it instead of printf!

    Also, prematurely optimizing the code removing std::endl it seems a bit excessive to me! But yeah, I get your point :)
  • 1
    @oudalally old school C# (could use some 'var' and string interpolation ;)
  • 6
    I can’t stop thinking about that first_name somewhere in memory void. Alone. Without a friend. Surrounded by flashing chaos and confusion.

    He’s just proudly sitting there. Waiting for his purpose. Waiting for his call.
  • 2
    It wouldn't work everywhere in the world though :-(
  • 1
    @Lezka Shure it would C++ with just stdlib features compiles everywhere!

    Although the above is still customary a lot of women keep there last name these days and men take there wife's name from time to time
  • 0
    Admit it, it was your code and you want to see if you are on the right path with your tutorials by asking about peoples reaction
  • 0
    This program also predicted your sexual preference
Add Comment