Showing posts with label c pointers. Show all posts
Showing posts with label c pointers. Show all posts
Monday, April 21, 2014
C Pointer Ex1
main(){
int *j;
{
int i=10;
j=&i;
}
printf("%d", *j);
getch();
}
|
Output
Similarly *j=&i; output: [Warning] assignment makes integer from pointer without a cast or *j=i; ERRORC pointer ex2
main(){
char *str1="abcd";
char str2[]="abcd";
printf( "%d %d %d %d",sizeof(str1),sizeof(*str1),sizeof(str2),sizeof("abcd"));
getch();
}
|
Output
c pointer ex1
| main(){ char *cptr,c; void *vptr, v; c=10; v=0; cptr=&c; vptr=&v; printf(" %c %v " , c,v); } |
OutPut
Subscribe to:
Posts
(
Atom
)




