[go: up one dir, main page]

0% found this document useful (0 votes)
4 views3 pages

Const 1

Uploaded by

Mai Gado
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views3 pages

Const 1

Uploaded by

Mai Gado
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

#include<stdio.

h>

int main()
{
int =128;
const int = ;
printf("%d\n", );
return 0;
}

int y=128; 'y'

const int x=y; 'x'


'y'

printf("%d\n", x); 'x'

#include<stdio.h>
int fun(int ** );

int main()
{
int =10;
const int * = & ;
fun(& );
return 0;
}
int fun(int ** )
{
int = 223;
int * = & ;
printf("Before changing ptr = %5x\n", * );
const * = ;
printf("After changing ptr = %5x\n", * );
return 0;
}

const int ** int **

#include<stdio.h>

int main()
{
const int =5;
const int * ;
= & ;
* = 10;
printf("%d\n", );
return 0;
}

const int x=5; x

const int *ptrx; ptrx

ptrx = &x; x

*ptrx = 10; x

const x *(int *)&x = 10;


#include<stdio.h>
int fun(int ** );

int main()
{
int =10, =20;
const int * = & ;
printf(" i = %5X", );
printf(" ptr = %d", * );
= & ;
printf(" j = %5X", );
printf(" ptr = %d", * );
return 0;
}

You might also like