Some constants define in headers of C++ (Part -2)

1. __SIG_ATOMIC_WIDTH__: It expands to 32.

#define __SIG_ATOMIC_WIDTH__ 32

2. _WRITE_ABORT_MSG: It expands to 0x1.

#define _WRITE_ABORT_MSG 0x1

3. _VALARRAY_AFTER_H: It expands to 1.

#define _VALARRAY_AFTER_H 1

This is defined in the header file valarray_after.h.

4. __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16: It expands to 1.

#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 1

5. BUFSIZ: It expands to 512.

#define BUFSIZ 512

This is defined in the header file stdio.h

Output:

32 1 1 1 512

Approach:

C++

#include <bits/stdc++.h>
using namespace std;

int main()
{

    cout << __SIG_ATOMIC_WIDTH__ << "\n";

    cout << _WRITE_ABORT_MSG << "\n";

    cout << _VALARRAY_AFTER_H << "\n";

    cout << __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 << "\n";

    cout << BUFSIZ << "\n";

    return 0;
}


No comments:

Post a Comment