----
char* ptr = “Hello”;         // Pointer and data are not const
const char* ptr = “Hello”; // Pointer is not const but data are const
char* const ptr = “Hello”;  // Pointer is const but data are not const
const char* const ptr = “Hello”;  // Pointer and data are const
void foo(const double& d1)  // d1 parameter cannot be modified inside foo function
{...}
----

It avoid not wished modifications


== See

* https://www.securecoding.cert.org/confluence/x/mwAV[CERT, STR05-C.] - Use pointers to const when referring to string literals


ifdef::env-github,rspecator-view[]
'''
== Comments And Links
(visible only on this page)

include::comments-and-links.adoc[]
endif::env-github,rspecator-view[]
