cout<<2["abc"]<<endl;输出c。不过这是什么语法啊,c++/c的,以前没遇到过,百度无果,有没有老司机带带啊。
拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...
a[b] is actually *(a + b) so the above code is equivalent to
a[b]
*(a + b)
#include <iostream> using namespace std; int main(void) { cout << *("abc"+2) << endl; return 0; }
Move a stackoverflow: http://stackoverflow.com/ques...
This example is mentioned on page 144 of "C and Pointers", so I will just screenshot it for you. The author does not recommend writing it this way.
Please ask the question under what circumstances did you encounter this problem? I'm a little curious about what this is.
Is this a mapping table?
a[b]
is actually*(a + b)
so the above code is equivalent to
Move a stackoverflow: http://stackoverflow.com/ques...
This example is mentioned on page 144 of "C and Pointers", so I will just screenshot it for you. The author does not recommend writing it this way.
Please ask the question under what circumstances did you encounter this problem? I'm a little curious about what this is.
Is this a mapping table?