DarkMatter in Cyberspace
  • Home
  • Categories
  • Tags
  • Archives

A Good Tutorial about C++ Syntax and Points


The whole tutorial C++ Language is concise and helpful. The section Pointers is a good introduction of pointers. It distinguishes many myth of pointers, for example:

  • It distinguishes "pointer declaration" of "dereference operation". They use both the same operator "*", but are different things.

  • Pointer and array are largely the same, but an import difference: pointer can be reassigned, while array variable can't.

  • Incrementation of a pointer produce different result regarding to the data type it referenced. Say a pointer p has the address 1000, according to its referenced type, the incrementation results are:

    char * p; p = 1000; p++ is 1001; short * p; p = 1000; p++ is 1002; long * p; p = 1000; p++ is 1004;



Published

May 29, 2014

Last Updated

May 29, 2014

Category

Tech

Tags

  • C++ 12
  • pointer 1

Contact

  • Powered by Pelican. Theme: Elegant by Talha Mansoor