need help with c++ questions 1-In the declaration statement int *i; what type of
ID: 3905378 • Letter: N
Question
need help with c++ questions
1-In the declaration statement
int *i;
what type of variable is i? (1 pt)
2-If a variable is declared as a pointer, what must be stored in the variable? (1 pt)
3-If average is a variable, what does &averagemean? (2 pts)
4-Using the indirection operator, write an expression for the variable pointed to by pDate: (2 pts)
5-Write a declaration statement for pCharwhich is a pointer to a character. (2 pts)
6-Write an English sentence that describes what is contained in the following: (2 pts)
double *dPtr;
7-Rewrite the following subscripted variable using pointer notation: (2 pts)
dist[9]
8-Rewrite the following pointer notation as a subscripted variable: (2 pts)
*(yrs + 10)
9-Describe what happens to the pointer in the following expressions: (4 pts)
*ptNum++
*++PtNum
10-Rewrite the following declaration statement using pointer notation and the newoperator. (2 pts)
int array[10];
Explanation / Answer
1) *i is a pointer variable of type int which can hold the address.
2) if a variable is declared as pointer then it can hold the address of a variable.
3) &average mean the address of the variable average located in memory.
4) *pDate
5) char *pChar;
6) *dptr is a pointer variable which can contain the addres of another double variable.
7)*(dist+9//in array index value starts from zero
8) yrs[10]
9)*ptnum++->value in that address will be incremented
*++PtNum->next address location to ptNum will be pointed now.
10)int *array = new int[10]
6)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.