0

Possible Duplicates:
const int = int const ?
Const in C

hi,

I would like to know the exact meaning of "int const* " in C ,And also a small comparison between "const int*" and "int const*" in an embedded programming system.

__kanu

Community
  • 1
  • 1
Renjith G
  • 4,446
  • 12
  • 40
  • 55

1 Answers1

5

What is the exact meaning of “int const* ” in C?

It means a pointer to a constant integer. In other words, the pointer is not constant, but the value it points to is.

And also a small comparison between "const int*" and "int const*"

There is no difference.

A similar construct is int * const. Here there is a difference. This time the pointer is constant but the value it points to is not.

Mark Byers
  • 767,688
  • 176
  • 1,542
  • 1,434
  • +1 but I would phrase that a little bit differently: "pointer to a memory region with constant integers" – Šimon Tóth Oct 09 '10 at 19:53
  • "A similar construct is int * const. Here the pointer is constant but the value it points to is not." what is the exact application/meaning of this usage? – Renjith G Oct 09 '10 at 19:57
  • See at below link. http://stackoverflow.com/questions/219914/what-use-are-const-pointers-as-opposed-to-pointers-to-const-objects – MCG Feb 01 '17 at 16:25