Question: 1 . Reading ( C ) code with ( C ) Using the file input / output function provided by the
Reading C code with C
Using the file inputoutput function provided by the C language, you can read other C files in the C language code. You should read the test.c file and write a program that outputs the data type and name of the variables used in this file.
The test.c file can have global variables, and if there are global variables, it must be after #include ie a global variable is not declared between the function and the function It can also have functions other than the main function, but for convenience, assume that the return value is void. Also, in the test.c file, all functions other than the main function is defined above the main function. If test.c has multiple functions, you must indicate which function the variables are in For example, the test.c file can be given as follows:
test.c
#include
float global
void funint af
int val:
void funint b
int num;
void main
int a bunderlineunderlinec
double d
mathrmamathrmbmathrmcunderlineunderline
d doubleunderlineunderlinea
printfTEST
return underlineunderline
If test.c is given as above, the output should be as below.
List of global variables
float type variable: global
List of variables included in fun function
inttype variable: val
List of variables included in fun function
inttype variable: num
List of variables included in the main function
inttype variable: a b c
Doubletype variable: d
Note: Only short, int, long, float, and double can exist in the data type of variables included in the test.c file assuming there are no complex data types such as arrays, pointers, and structures
Functional prototype: There is no separate function that needs to be implemented.
Restrictions: Ban the use of global variables.
Input: There is no separate input required by keyboard but read test.c file through file input testc assumes it is in the same path as file C you submit
Output: Outputs the data types and variable names included in test.c on each line.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
