Asked by Digtzy
(4 points) Identify the errors in the following statements.
int* p = &44;
- i think the star is the error because pointers are supposed to be like *p??
char c = 'w';
char p = &c;
- if its char wouldnt that also be in apostrophe?
So char c= 'w' and char p = '&c' or &'c'???
char c = 'w';
char* p = c;
- still with the star thing, does that not go directly before variable?, also the c not in apostrophes?
float x = 3.14159
float* p = &x;
int d = 44;
int* q = &d;
p = q;
-maybe im wrong but i really thought the star goes directly before. I think i am now. I know the star declares a pointer. I don't know the error in this one
int* p = &44;
- i think the star is the error because pointers are supposed to be like *p??
char c = 'w';
char p = &c;
- if its char wouldnt that also be in apostrophe?
So char c= 'w' and char p = '&c' or &'c'???
char c = 'w';
char* p = c;
- still with the star thing, does that not go directly before variable?, also the c not in apostrophes?
float x = 3.14159
float* p = &x;
int d = 44;
int* q = &d;
p = q;
-maybe im wrong but i really thought the star goes directly before. I think i am now. I know the star declares a pointer. I don't know the error in this one
Answers
Answered by
Steve
first step: try compiling the code. What errors do you get?
There are no AI answers yet. The ability to request AI answers is coming soon!
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.