what is the wrong?...this massage came when i decleration a pointer in my program and use it !!

taimor
Recommended Answers
Jump to PostOn line 4 you declare
o
asint *o=new int;
. This ony gives you a single int pointer. So when you call line 16 you invalidate the pointer because you step out of the memory allocated to it. It looks to me like you needo
to be an array. …
Jump to PostYes. You need to figure out the size that you need
o
to be and then you use that size to allocate the memory you need with new.
All 7 Replies
Suzie999 245 Coding Hobbyist
zain.imtiaz 0 Newbie Poster

taimor
NathanOliver 429 Veteran Poster Featured Poster

taimor
NathanOliver 429 Veteran Poster Featured Poster

taimor
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.