Programming in C 17 Chapter 3 section 37 and Chapter 5 secti

Programming in C, 1-7

Chapter 3 section 3.7, and Chapter 5 section 5.8 of Delores Etter’s Engineering Problem Solving with C. Answer the questions below in a typed document, numbered appropriately. Thank you!

1) Write a declaration statement for a 1-D array called timedata with a length of n, where n is a pre-declared integer variable. (In other words, n has already been declared in advance.) (Remember, you cannot initialize variable-length arrays in a declaration statement) 2) Write a declaration statement for a 2-D array called wavedata with a width of 2 and a length of 10 3) Write the same declaration, but for a 2-D array with a width of 2 and a length of rn Write the declaration statement for a file pointer to represent wave data, and then write a file assignment statement for that pointer that opens a file, defined as a symbolic constant FILENAME, as a read file. 4)

Solution

********Question-1*****   

int n=10;
   int timedata[n];

****************Question-2******

   int wavedata[2][10];
   int wavedata[2][n];

***********Question-3************
   FILE *fin;
char FILENAME[] = \"input.txt\";

//fin = fopen(FILENAME, mode);

fin = fopen (FILENAME, \"r\");
******************

Programming in C, 1-7 Chapter 3 section 3.7, and Chapter 5 section 5.8 of Delores Etter’s Engineering Problem Solving with C. Answer the questions below in a ty

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site