PhotoArt web site
Some selected photographs rearranged in my new photo blog.
Take a look!
const pointer vs. pointer to const
/*
ex. usage of a constant pointer to a (variable integer)
ex. how to fuck a pointer to a constant variable
*/
#include
int main(void)
{
const int c=0;
// constant pointer to a (variable) integer: can change the value of the var but not the pointer
int* const ptr1 = malloc(sizeof(int));
*ptr1 = 10;
*ptr1 = 100;
int t;
// pointer to a constant integer: can change the pointer but not the variable
const int* ptr2 = malloc (sizeof(int));
int modvar = 10;
ptr2 = &modvar;
modvar = 100;
printf(”%d\n”,