Question
(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
first step: try compiling the code. What errors do you get?
Related Questions
I believe I have found all the mistakes. What do you think?
Identify Twenty Errors in the Pass...
Can you take a look and tell me what you thing? Thanks
Review the passage below, which contains...
Identify Twenty Errors in the Passage Below
Review the passage below, which contains 20 errors. I...
Which of the following statements is FALSE?
Syntax errors are usually easier to fix than logic...