সব বই

পেশাদার

1 Markets I: The Ecosystem and Exchange-Traded Marketsবাজার অনলাইন 2 Markets II: Rates, FX and Creditবাজার অনলাইন 3 Markets III: Commodities, Energy and Cryptoবাজার অনলাইন 4 Quantitative Methodsপদ্ধতি অনলাইন 5 Derivatives and Volatilityডেরিভেটিভস অনলাইন 6 Rates, Credit, XVA and Riskসুদহার, ঋণ ও ঝুঁকি অনলাইন 7 Research Craft: Predictors, Backtests, Measurement, Portfoliosগবেষণা অনলাইন 8 Strategies I: Equities and Futuresকৌশল অনলাইন 9 Strategies II: Volatility, Relative Value, Macro and the Bank Desksকৌশল অনলাইন 10 Microstructure and Executionএক্সিকিউশন অনলাইন 11 Market Making and High-Frequency Tradingমার্কেট মেকিং অনলাইন 12 Machine Learning for Marketsমেশিন লার্নিং অনলাইন 13 Low-Latency Softwareপ্রযুক্তি অনলাইন 14 Networks, Hardware and Trading Infrastructureপ্রযুক্তি অনলাইন 15 Research, Data and Risk Platformsপ্রযুক্তি অনলাইন 16 The Desk and the Firmপ্রতিষ্ঠান অনলাইন 17 The Industry: Firms, Roles and Careersক্যারিয়ার অনলাইন 18 Interviews I: Maths, Probability and Speedক্যারিয়ার অনলাইন 19 Interviews II: Markets, Trading Games and the Final Roundক্যারিয়ার অনলাইন 20 Interviews III: Codeক্যারিয়ার অনলাইন
অ্যাপ পরিচিতি Coach সাইন ইন পড়া শুরু করো

বইগুলো এখনো বাংলা ভাষায় পাওয়া যায় না — ইংরেজি সংস্করণ দেখানো হচ্ছে।

Computer Science · পরিভাষা

Constructor, destructor কী?

অন্য নাম: constructor (C++) · destructor

Definition 1.6 University Computer Science — Year 2 · অধ্যায় 1 — From C to C++: Classes and Resource Management

A constructor of a class C is a member function named C, without a return type, that the compiler calls each time an object of C is created; its member initialiser list (after the :) gives each data member its first value. The destructor ~C() is the member function the compiler calls when the object’s lifetime ends; a class has exactly one.

উদাহরণ

Example 1.8 (Building 6/(−8)6/(-8))

The initialiser list sets num_ = 6, den_ = -8. The body finds den_ nonzero and negative, so it negates both, −6/8-6/8, then divides both by gcd⁡(−6,8)=2\gcd(-6, 8) = 2 (std::gcd returns a non-negative result): −3/4-3/4. The sum a + b is built by the constructor too, from (−3)⋅4+1⋅4=−8(-3)\cdot 4 + 1 \cdot 4 = -8 over 1616, and comes out as −1/2-1/2. The expression a + 1 works because Fraction(long whole) is a constructor with one argument: the compiler uses it to convert 1 into 1/11/1. The defaulted operator== compares the members one by one, which is correct only because the invariant makes the representation unique.

প্রসঙ্গসহ পড়ো →