I have used Code::blocks 12 compiler for debugging purpose. But you can use any C programming language compiler as per your availability.
Write C program to change the value of constant integer using pointers
#include <stdio.h> int main() { const int a=20; //declare and assign constant integer int *p; //declare integer pointer p=&a; //assign address into pointer p printf("Before changing - value of a: %d",a); //assign value using pointer *p=40; printf("\nAfter changing - value of a: %d",a); printf("\nValue has changed."); return 0; }
15 March 2019 2262 Written By: Rohit
© 2020 Tech Study. All rights reserved | Developed by Tech Study| Privacy Policy | Sitemap