1int nums[100] = {0}; // initiallize all values to 0
2
3int nums[5] = {1,2,3,4,5};
4
5// type name[size] = {values};
1#include <iostream>
2
3// macro definition
4#define LIMIT 5
5
6int main()
7{
8 for (int i = 0; i < LIMIT; i++) {
9 std::cout << i << "\n";
10 }
11
12 return 0;
13}
1You can use '#' sign to get exact name of an argument passed to a macro:
2#define what_is(x) cerr << #x << " is " << x << endl;
3int variable = 376;
4what_is(variable);
5// prints "variable is 376"