Question: The C and C++ languages are known for their pre-compilation directives. One of them, #define allows to define macros and symbolic constants I have a

 The C and C++ languages are known for their pre-compilation directives.

The C and C++ languages are known for their pre-compilation directives. One of them, #define allows to define macros and symbolic constants I have a something.cpp file and I'd like to extract from it all the lines which are defining an integer constant. The syntax of #define might get pretty involved, however, in order to define a symbolic constant, one has only to do the following #define RESPONSE 42 #define INTERGER PI 3 Keep in mind the following rules; . The #define might start at the beginning of the line or be proceeded by an arbitrary number of spaces or tabs. It is never preceeded by anything else. The spacing between the constant name and its integer value is also variable We will restrict ourselves to integer values, up to 6 digits only. symbolic constants only using upper case letters Design a regular expression that you may use with egrep to extract all the lines from something.cpp which define such integer symbolic constants

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!