If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Re: error on a code

Originally Posted by Cambalinho

to a pointer must be initializated to NULL, when we don't know the value\reference, right?

It's a good idea, but you have to assign it a value before you try and access what it points to. As you're finding out, dereferencing a pointer that points to NULL, or an address that doesn't belong to your app will cause a crash. You're not point to a b object, yet you're using it as if it does.

Re: error on a code

Originally Posted by GCDEF

It's a good idea, but you have to assign it a value before you try and access what it points to. As you're finding out, dereferencing a pointer that points to NULL, or an address that doesn't belong to your app will cause a crash. You're not point to a b object, yet you're using it as if it does.

these code is for give EmptyText the empty spaces of p->Text size.
(transform any character to ' '(space))
but by some reason the loop don't work with all string size
can anyone advice me?

Good grief. Arrays are 0 based. Say Text = "dog". Text.length will return 3. EmptyText will therefore contain 4 bytes.
When you loop from 0 through Text.length(), you're trying to access the fourth character of Text, which doesn't exist. Further, at the end of your loop, i will have the value 4. You then try to set EmptyText[i + 1], which is EmptyTex[5], but the highest valid index of EmptyText is 3.

* The Perfect Platform for Game Developers: Android
Developing rich, high performance Android games from the ground up is a daunting task. Intel has provided Android developers with a number of tools that can be leveraged by Android game developers.

* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.