Char pointer weird expression in c -


this question has answer here:

i know why code running.

code:

#include <stdio.h>  int main(int argc, char* argv[]) {         char* c = "1234567";         printf("%c\n", 5[c]);          return 0; } 

result:

6

if confused a[b] syntax, refresh c knowledge.

a[b] defined *(a + b) , since a+b same b+a, a[b] , b[a].


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -