Yes, GCC/G++ can dump its default preprocessor defines using the -dM and -E options together. Here's the command:
gcc -dM -E - < /dev/null
Or for G++:
g++ -dM -E - < /dev/null
This will output all the predefined macros, including ones like GNUC, STDC, and others, to the console. Here's what each flag does:
input.
If you are preparing for programming certifications or interviews and need more practice, you can also explore practice exams from this source: https://www.pass4future.com/questions/giac/gccc