Code
#include "stdafx.h"
#include "stdlib.h"
#include "stdio.h"
#include "string.h"
#include "iostream.h"
int main(int argc, char* argv[])
{
int a[6]={1,2,3,4,5,6};
int * ptr=(int*)(&a+1);
printf("Hello World! %d,%d,%d,%d ,%d\n",*(ptr-1),sizeof(a),a,&a+1,&a[1]);
char c[7]="abcdef";
char * ptr1=(char*)(&c+1);
printf("%d,%d,%d\n",c,&c[0],&c+1);
char *c1;
c1=(char*)malloc(sizeof(char)*6);
printf("%d,%d\n",c1,&c1[1]);
int *d;
d=(int*)malloc(sizeof(int)*6);
printf("%d,%d\n",d,&d[1]);
char *str1="abc";
char *str2="abc";
char str3[]="abc";
char str4[]="abc";
const char str5[]="abc";
const char str6[]="abc";
const char* str7="abc";
const char* str8="abc";
int i;
printf("%d,,",&i);
int *it=&i;
*it=1;
char c2;
char *c3=&c2;
strcpy(c3,"hello");
char *c4=(char*)(c3+4);
puts(c3);
*c4='\0';
printf("|%c|",*c4);
puts(c3);
printf("%d,%d,%d,%d",str1==str2,str3==str4,str5==str6,str7==str8);
return 0;
}
#include "stdafx.h"
#include "stdlib.h"
#include "stdio.h"
#include "string.h"
#include "iostream.h"
int main(int argc, char* argv[])
{
int a[6]={1,2,3,4,5,6};
int * ptr=(int*)(&a+1);
printf("Hello World! %d,%d,%d,%d ,%d\n",*(ptr-1),sizeof(a),a,&a+1,&a[1]);
char c[7]="abcdef";
char * ptr1=(char*)(&c+1);
printf("%d,%d,%d\n",c,&c[0],&c+1);
char *c1;
c1=(char*)malloc(sizeof(char)*6);
printf("%d,%d\n",c1,&c1[1]);
int *d;
d=(int*)malloc(sizeof(int)*6);
printf("%d,%d\n",d,&d[1]);
char *str1="abc";
char *str2="abc";
char str3[]="abc";
char str4[]="abc";
const char str5[]="abc";
const char str6[]="abc";
const char* str7="abc";
const char* str8="abc";
int i;
printf("%d,,",&i);
int *it=&i;
*it=1;
char c2;
char *c3=&c2;
strcpy(c3,"hello");
char *c4=(char*)(c3+4);
puts(c3);
*c4='\0';
printf("|%c|",*c4);
puts(c3);
printf("%d,%d,%d,%d",str1==str2,str3==str4,str5==str6,str7==str8);
return 0;
}