-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy path14.1 MacroConstants.cpp
More file actions
32 lines (26 loc) · 733 Bytes
/
Copy path14.1 MacroConstants.cpp
File metadata and controls
32 lines (26 loc) · 733 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <iostream>
#include<string>
using namespace std;
#define ARRAY_LENGTH 25
#define PI 3.1416
#define MY_DOUBLE double
#define FAV_WHISKY "Jack Daniels"
/*
// Superior alternatives (comment those above when you uncomment these)
const int ARRAY_LENGTH = 25;
const double PI = 3.1416;
typedef double MY_DOUBLE;
const char* FAV_WHISKY = "Jack Daniels";
*/
int main()
{
int MyNumbers [ARRAY_LENGTH] = {0};
cout << "Array's length: " << sizeof(MyNumbers) / sizeof(int) << endl;
cout << "Enter a radius: ";
MY_DOUBLE Radius = 0;
cin >> Radius;
cout << "Area is: " << PI * Radius * Radius << endl;
string FavoriteWhisky (FAV_WHISKY);
cout << "My favorite drink is: " << FAV_WHISKY << endl;
return 0;
}