constants


can a constant pointer be changed during for iterations?


I've just started learning C++ with openCV and came across a weird thing, for me at least...
in this code, there's a for loop, in which there is an assignment to a "const uchar*" as a function of the index (j).
for(int j = 1; j < myImage.rows - 1; ++j)
{
const uchar* previous = myImage.ptr<uchar>(j - 1);
const uchar* current = myImage.ptr<uchar>(j );
const uchar* next = myImage.ptr<uchar>(j + 1);
uchar* output = Result.ptr<uchar>(j);
for(int i = nChannels; i < nChannels * (myImage.cols - 1); ++i)
{
*output++ = saturate_cast<uchar>(5 * current[i]
-current[i - nChannels] - current[i + nChannels] - previous[i] - next[i]);
}
}
As far as I know, constants can only be assigned once, during the construction, so what is going on in here?
I think I am missing a big part of the algorithm, and wish to understand its nature.
Please don't refer to the implementation itself for it is known to be non effective whatsoever. Also it's my first question posted to StackOverflow, so please consider ;)

Related Links

Evaluate Irrational with Julia
Why do we put integer values in Constant class in Java/Android?
What is the difference between “const” and “val”?
Global constants in Dragon NaturallySpeaking's advanced scripting
What are the “hidden constants”?
Are there a constants in scapy for TCP and UDP?
Where can I find a list of constants for Request Transaction Types for Authorize.Net's API?
When we will consider the constants in asymptotic notations?
Why does Pybrain predict always the same value ?
How can I set a constant in autoconf checking for a program?
Error: <signal> is not a constant
What is the write constant [duplicate]
can a constant pointer be changed during for iterations?
What is the value of ABAP constants with prefix “%_”?
introducing constants in solve function
private type declaration is throwing error?

Categories

HOME
visual-studio-2015
xamarin.android
matplotlib
dataframe
file-io
docker-windows
google-spreadsheet-api
contact-form-7
unity2d
cortex-a
data-synchronization
typeahead
cloudflare
lstm
spring-cloud-config
dendrogram
zoomcharts
off-canvas-menu
prediction
tarantool
iup
source-maps
jquery-waypoints
samsung-mobile
onesignal
net-snmp
continuous-deployment
interrupt-handling
configure
cell-array
vegan
smart-mobile-studio
data-extraction
color-scheme
rider
bing-maps-api
forecasting
redhat-datavirt
axis-labels
delphi-10.1-berlin
g1gc
facebook-chatbot
encapsulation
onmouseover
aqgridview
ogre3d
greenhills
jexl
etherpad
tofixed
hpcc
python-hypothesis
vici
efxclipse
atlassian-crowd
sql-server-administration
coremidi
pydio
aescryptoserviceprovider
database-backups
amazon-kcl
acm
difference
android-cursoradapter
vips
evo
response-headers
sevenzipsharp
ipojo
gulp-livereload
guzzle6
google-earth-plugin
client-side-validation
cpu-speed
odftoolkit
scala-2.11
vcl
bsp
ssms-addin
ifft
reserved-words
flash-cc
edit-in-place
bsod
nimrod
va-list
haskell-platform
windows-update
carddav
adomd.net
client-library
htmltextwriter
transitive-closure-table
lync-server-2010
javascriptserializer
tfs-power-tools
shim
objective-c-protocol
zookeeper
django-nose
testunit
nvelocity
zend-form-element
rijndael
pureftpd
sitemappath
unreachable-code
callgrind
divx

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App