| gladi (47) | |||||||
|
HI everyone can you help by finding the error in these codes. Can you explain it. First Code:
Second:
Third:
| |||||||
|
Last edited on
|
|||||||
| gladi (47) | |
I just find out the second one which we have to change increment to a pointer.for (; *s != '\0'; ++*s)is it Right?! | |
|
|
|
| MiiNiPaa (232) | |
|
First: You can't use pointer ariphmetic on void pointers. Second: You cannot increment array pointer. Third: You are trying to store pointer in double. Next time do your homework yourself. | |
|
|
|
| EssGeEich (1007) | |
|
You didn't even compile those snippets, did you? @MiiNiPaa Your answer to the first question has a mistake, as that isn't pointer arithmetic, but you cannot dereference a void pointer. | |
|
|
|
| gladi (47) | ||
first: Thank you for your time to comment on my post, Second This is not a homework I just want to post this to discuss as you can see in my second post. I would like to make discussion with people who are better than me because I am a beginner in C++. Yes EssGeEich I tried to compile them but I need some elaborate about how this code work. I thank you so much. | ||
|
|
||