Question:Write a c program to modify the constant variable in c? 

Answer You can modify constant variable with the help of pointers. For example:
#include<stdio.h>
int main(){
    int i=10;
    int *ptr=&i;
    *ptr=(int *)20;
    printf("%d",i);
    return 0;
}
Output: 20 

+ Report
Total Preview: 1478
Write a c program to modify the constant variable in c?
Copyright © 2024. Powered by Intellect Software Ltd