c programming. PLS ANSWER ALL THANK U!refer to the following code segment to answer the questions. Eachquestion is independent from each other.
#define MAX_A 50#define MAX_B 20
typedef double arr2D[MAX_A][MAX_B];typedef char string[MAX_B];typedef string arrWords[MAX_A];
void f1(double);void f2(double []);void f3(double [][MAX_B]);void f4(double *);void fA(char);void fB(char *);void fC(string);void fD( ________ );
intmain(){ arr2D aValues; /*assume aValues is allocated spacestarting at address 0030 (in decimal). */ string strA, strB; /* assume strA is allocatedspace at starting at address 8050 (in decimal). */ arrWords sentence; /* assume sentence is allocatedspace starting at address 9070 (in decimal). */ //Assume all variables are initialized withvalues.
// to be replaced with code or function call (inthe succeeding questions)
return 0;}
QUESTIONS
1. What is the starting address associated to strB , if memoryspace for strB is allocated directly after the memory spacesallocated for strA?
2. What is the value of &aValues[1][1]? [Hint: the value is an address]
3. Assume function call below will replace the comment in themain(). What should be the actual parameter if we want topass the starting address of the fifth character stored in fourthrow of sentence? The answer SHOULD use array indexing notation.Remove all spaces from your answer.
4. Assume function call below will replace the comment in themain(). What should be the actual parameter if we want topass the address of the string stored in strB concatenated to strA?Note that strA is the one that should contain the concatenatedstring. [Hint: Your answer includes the function call tostrcat().] Remove all spaces from your answer.
5. Assume function call below will replace the comment in themain(). What should be the data type in the formal parameterin the function prototype of fD()? Note that your answer should notinclude any variable name. Remove all spaces from youranswer.
c programming. PLS ANSWER ALL THANK U! refer to the following code segment to answer the questions. Each question is ind
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am