how to represent pre-increment pointer, pre-decrement pointer, post-increment pointer and post-decrement pointer
how to represent pre-increment pointer, pre-decrement pointer, post-increment pointer and post-decrement pointer
What do you think? Ever tried to use this awesome website?
1. Get rid of gets(). Never ever ever use it again. Replace it with fgets() and use that instead.
2. Get rid of void main and replace it with int main(void) and return 0 at the end of the function.
3. Get rid of conio.h and other antiquated DOS crap headers.
4. Don't cast the return value of malloc, even if you always always always make sure that stdlib.h is included.
The same way you pre-increment, pre-decrement, post-increment and post-decrement a variable of some numeric type.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
Given your other thread - are you just posting homework questions?
> Given your other thread - are you just posting homework questions?
I agree.
One more "one line question without effort looking like an exam question post", and they're out of here.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Is this correct for pre decrement "--*p", post-decrement "*P++".
Is this correct for pre decrement "--*p", post-decrement "*P--".
Think: what are you trying to decrement?
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
Well it depends what you're trying to increment or decrement.
You can change the pointer, or you can change what it points to.
There are 8 possibilities here - can you list them all, and describe what each one does?
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.