๐ข C++ Function Parameters – Jab Kaam Guddu Kare, Aur Credit Shyamlal Le Jaaye!
Software company me Guddu aur Shyamlal ek hi team me kaam kare la. Manager Mishra ji bole:
Guddu mehnat se code likh dehla – by value se. Shyamlal chhupke by reference ka use karke sab boss ke tareef le jaata ๐
๐งพ By Value – Jab Tumhare Effort Ke Copy Ho Jaaye, Aur Original Tumhare Paas Rahe
void incrementScore(int score) {
score = score + 10;
}
Call karte time:
int gudduScore = 50;
incrementScore(gudduScore);
cout << gudduScore; // Output: 50
Guddu: “Sir, maine value bheji thi, par asli score to waise ke waise baa!”
Mishra ji: “Bhai, ee to copy bhejl baa… original untouched baa!”
๐ต️ Office Politics Angle:
Kaam forward ho gaya email me, par tumhare naam se nahi. Tum effort kare, par koi aur meeting me credit le gaya ๐ค
๐ By Reference – Jab Direct Original Par Haath Daale Jaaye
void incrementScore(int &score) {
score = score + 10;
}
Call karte time:
int shyamlalScore = 50;
incrementScore(shyamlalScore);
cout << shyamlalScore; // Output: 60
Shyamlal (smirking): “Sir, dekhiye! Score badh gayil... direct change!”
Guddu (ghusse me): “Ee to asli file edit kar diye!”
Mishra ji: “Reference use kare ke power hi alag baa!”
๐ต️ Office Politics Angle:
Direct boss ke ear me baat ghoosa diye… email forward na karna padal, seedha impression ban gayil!
๐ญ By Value vs By Reference – Corporate Gossip Table
| Aspect | By Value | By Reference |
|---|---|---|
| Kaam | Copy pe kaam | Original pe kaam |
| Credit | Tumhare naam se kaam gayab | Tum direct highlight ho jaata |
| Performance | External effort, no effect inside | Direct internal impact |
| Syntax | int value | int &value |
๐ฌ Ek Aur Office Joke:
Guddu: “Sir, aapne bola file bhejo, maine copy bhej diya.”
Mishra ji: “Beta, tum reference bhejte to main actual kaam dekh paata!” ๐
๐ผ Real-Life Example – Employee Salary Increment
// By Value
void giveIncrement(int salary) {
salary += 5000;
}
// By Reference
void giveRealIncrement(int &salary) {
salary += 5000;
}
int salary = 20000;
giveIncrement(salary); // salary = 20000
giveRealIncrement(salary); // salary = 25000
Guddu: “Copy salary pe increment de ke kya milega?”
Shyamlal: “Original salary me paisa ghoos gaya, samjha karo!”
๐ Internal Links:
- ๐ Function Declaration aur Definition – Jab Manager kaam bataye, aur Guddu paseena bahaaye
- ๐ C++ Variables – Jab Guddu GF ke liye gift reserve kare
- ๐ Ternary Operator – Jab Code me horror story likhal jaai!
๐ External SEO Links:
- ๐ GeeksforGeeks – Function Parameters in C++
- ๐ฌ StackOverflow – Difference between pass by value and reference
- ๐ Medium – C++ Parameter Passing Explained
๐ง Conclusion – Corporate Office aur C++ ka Code, Dono me Politics Same Baa!
Kaam ke kauno method use karo – value ya reference, samjha ja chahi ki:
- Kaam copy pe ho raha baa ya original file pe?
- Tum effort de rahe ho, ya koi aur uska fruit khaat baa?
๐ฎ Agla Topic Suggestion:
Function Overloading in C++ – Jab Office me ek hi employee se sab kaam le le jaala!

No comments:
Post a Comment