c - WHY the following program is not giving error? -


#include<stdio.h> void main () {      int a=4;      const int *p=&a;       *p--;       } 

in above line means can not change value via p, in decrement statement should give error not giving error. can explain why??

*p-- decrements p not contents of p.

if (*p)-- compilation error

error: decrement of read-only location ‘*p’ 

Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -