write a C program to modify the constant variable
Attachments:
Answers
Answered by
2
#include<stdio.h>
void main()
{
const int i=10;
int *ptr = &i;
*ptr = (int *)20;
printf("%d",i);
return 0;
}
Output: 20.
Hope this helps!
void main()
{
const int i=10;
int *ptr = &i;
*ptr = (int *)20;
printf("%d",i);
return 0;
}
Output: 20.
Hope this helps!
Similar questions