cpp4python icon indicating copy to clipboard operation
cpp4python copied to clipboard

Inconsistent example in Section 2.5.2

Open PeturOA opened this issue 1 year ago • 1 comments

Toward the end of section 2.5.2, there is an output demonstration that has gone out of sync with the code that is doing the outputting:

If your compiler does not catch that error (the one for this class may), the first cout instruction outputs:

After changing *ptrN, varN now has: 50

This should be

varN value: 50

Actually, that doesn't seem quite right either. Pointing the pointer to memory address 100 should not affect the value of varN, right? This paragraph could probably use a little review.

The current text is a vestige of an older version that was changed here: https://github.com/pearcej/cpp4python/commit/658b847abdf26c26272bcbce67702c1752fdcf66#diff-6eb1711948c06b3d2b33b97e9c4327afe3619bf0daa3a649bbe69a6d64bb60bc See https://github.com/pearcej/cpp4python/blame/791717a1b1f4447ef0318f050bd4c864ccb6bc20/_sources/Data_Types_and_Operators/GettingStartedwithData.rst#L355

PeturOA avatar Jan 30 '24 16:01 PeturOA

Working on this. Thank you for the issue @PeturOA

nathanwoohooyay avatar Jun 12 '24 13:06 nathanwoohooyay