Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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. 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started