Shivangi Srivastava
Shivangi Srivastava
Shivangi Srivastava
• Inheritance © SDC
int main()
{
int a = 5; // 'a' is L-value
float b = 0.9f;
printf("Hello world %d %3.1f \n", a, b);
std::cout << "Hello world" << a << " "
<< b << " " << std::endl;
return 0;
}
Data types
• bool (true 1, false 0)
INTEGRAL • char (could be signed or unsigned
– implementation-defined)
• int (signed by default)
ARITHMETIC • double
• void (“pseudo-type”)
• enum
USER-DEFINED • class
• also short, long, struct, float,
wchar_t, etc.)
void OpenDevice()
{
if (bad) throw MyException(“Cannot open device”);
}
THANK YOU