By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,776 Members | 1,351 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,776 IT Pros & Developers. It's quick & easy.

problem in pointer to pointers

P: 10
Expand|Select|Wrap|Line Numbers
  1. #include<stdio.h>
  2. char *c[]={“ENTNG”, “NST”,”AMAZI”,”FIRBE”};
  3. char** cp[]={c+3, c+2, c+1, c};
  4. char ***cpp= cp;
  5. void main() {
  6. printf(“%s”,**++cpp);
  7. printf(“%s “,*--*++cpp+3);
  8. printf(“%s”,*cpp[-2]+3);
  9. printf(“%s”,cpp[-1][-1]+1);
  10. }
  11.  
  12.  
how to solve this *cpp[-2]+3 ??
what does [-2] here means??
Nov 28 '10 #1
Share this Question
Share on Google+
1 Reply


100+
P: 687
at this moment, cpp was advanced to point to cp[2], so cpp[-2] points to cp[0] that holds value c+3, pointer to "FIRBE".
Nov 28 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.