Skip to content

Instantly share code, notes, and snippets.

@xnuk
Created April 12, 2014 13:57
Show Gist options
  • Save xnuk/10537051 to your computer and use it in GitHub Desktop.
Save xnuk/10537051 to your computer and use it in GitHub Desktop.
#include<stdio.h>
#include<conio.h>
#define N 5
int main(){
char cname[N]="abcd";
int i;
printf("%d\n", sizeof(cname));
printf("%p %p\n", cname, &cname);
printf("%p %p\n", cname+1, &cname+1);
for(i=0; i<N; i++){
printf("[%d] %p: %c\n", i, &cname[i], cname[i]);
cname[i]='A'+i;
}
for(; i>0; i--)printf("[%d] %p: %c\n", i-1, &cname[i-1], cname[i-1]);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment