Powered by Invision Power Board

 
  Pages: (3) [1] 2 3  ( Go to first unread post ) Closed TopicStart new topicStart Poll

> Retriever or Lightning, I'm Stupid
United States
OniLink10
Posted: Jan 23 2009, 08:36 PM
Quote Post


C++ Programmer, Unofficial Physicist, and Unofficial Chemist
[*][*]

Group Icon
Group: Members
Posts: 3920
Member No.: 4907
Joined: 19-February 08

Status: (0d) [--]


I am officially the dumbest programmer ever.

How do I destruct a Dynamically Allocated Object without deleting the Pointer Variable to it.

RUNTIME ERRORS SUCK!


--------------------
QUOTE (Xgoff @ Sep 10 2009 @ 06:11 PM)
did you try hello's engine

make sure to not ****ing change anything before using it!
PMEmail PosterUsers WebsiteYahoo
Top
Finland
Raccoon Sam
Posted: Jan 23 2009, 08:38 PM
Quote Post


You need to get off your high horse.
[*][*][*][*][*]
[*][*][*][*]

Group Icon
Group: Members
Posts: 9707
Member No.: 1422
Joined: 6-September 05

Status: (0d) [--]


This is the CCC


--------------------

user posted image
read it yo
PMEmail PosterUsers WebsiteAOLMSN
Top
United States
OniLink10
Posted: Jan 23 2009, 08:40 PM
Quote Post


C++ Programmer, Unofficial Physicist, and Unofficial Chemist
[*][*]

Group Icon
Group: Members
Posts: 3920
Member No.: 4907
Joined: 19-February 08

Status: (0d) [--]


QUOTE (Raccoon Sam @ Jan 23 2009, 05:38 PM)
This is the CCC

If I posted it in Help, people would tell me to PM them. Lightning never answers the PMs I occasionally send him, and I'd rather that they know when someone has solved it.


--------------------
QUOTE (Xgoff @ Sep 10 2009 @ 06:11 PM)
did you try hello's engine

make sure to not ****ing change anything before using it!
PMEmail PosterUsers WebsiteYahoo
Top
United States
Retriever II
Posted: Jan 23 2009, 08:45 PM
Quote Post


Catalyst
[H][*][*][*][*]
[*][*][*][*][*]


Group Icon
Group: Members
Posts: 18290
Member No.: 52
Joined: 13-October 03

Status: (0d) [--]


I don't really understand your question.

Are you asking how to destruct an object without freeing its memory?


--------------------

PMEmail PosterUsers WebsiteICQAOLMSN
Top
United States
OniLink10
Posted: Jan 23 2009, 08:53 PM
Quote Post


C++ Programmer, Unofficial Physicist, and Unofficial Chemist
[*][*]

Group Icon
Group: Members
Posts: 3920
Member No.: 4907
Joined: 19-February 08

Status: (0d) [--]


QUOTE (Retriever II @ Jan 23 2009, 05:45 PM)
I don't really understand your question.

Are you asking how to destruct an object without freeing its memory?

No, destruct and Object and free its Memory WITHOUT deleting the Pointer Variable that pointed to it.

Here's my first attempt, but the runtime error still occurs:
vector::iterator t = Objects.begin();
while (!Objects.empty())
t = Objects.erase(t);
The class Object is a Base Class and the vector Objects is an Object List.

For some reason, doHTML won't let me use <Object*>, it just removes it.


--------------------
QUOTE (Xgoff @ Sep 10 2009 @ 06:11 PM)
did you try hello's engine

make sure to not ****ing change anything before using it!
PMEmail PosterUsers WebsiteYahoo
Top
United States
Zero Kirby
Posted: Jan 23 2009, 08:57 PM
Quote Post


Well, your local psychic is off to visit your mother!
[*][*][*][*]

Group Icon
Group: Members
Posts: 6252
Member No.: 2501
Joined: 15-August 06

Status: (0d) [--]


QUOTE (OniLink10 @ Jan 23 2009, 06:40 PM)
If I posted it in Help, people would tell me to PM them. Lightning never answers the PMs I occasionally send him, and I'd rather that they know when someone has solved it.

People are still going to tell you to PM them and they'll be much meaner about it and I'm pretty sure there's a rule against posting Help topics in the CCC so if you get banned you'll still have to post it in Help

And get told to PM them in there

This post has been edited by Zero Kirby on Jan 23 2009, 08:57 PM


--------------------
Falcon Punch is the result of the Sun heating fists. It drives the Blue Falcon. Heating causes destruction of water into the pain, where it then hurts, creating rain. Rain creates flowing water in tears, which can then be converted into other forms through more pain.

My Ref - Full Body Ref (minus the badass hat)

Visit Just Another Just Another Day - The Webcomic!

Super Mario Zero: Game Status (RAZZ Y U STEALING MAH FORMAT BRO)
Mario Object: Pretty much finished!
Enemy Objects: [||||||||--] Just gonna add Spinies, Bullet Bills and Cheep Cheeps!
Boss Fights: None in progress.
General Engine: [|||||||||-] Ranking System Complete! Gonna add pipes!
Levels Complete: [|---------] Haven't even finished the tutorial!
PMUsers WebsiteAOLMSN
Top
United States
Retriever II
Posted: Jan 23 2009, 08:58 PM
Quote Post


Catalyst
[H][*][*][*][*]
[*][*][*][*][*]


Group Icon
Group: Members
Posts: 18290
Member No.: 52
Joined: 13-October 03

Status: (0d) [--]


Erasing an element from a vector invalidates the iterator, because elements get shifted around to fill in the gaps you create.

Use the clear() method to empty your vector, or use the ranged version of the erase() function: iterator erase ( iterator first, iterator last );

http://www.cplusplus.com/reference/stl/vector/erase.html


--------------------

PMEmail PosterUsers WebsiteICQAOLMSN
Top
United States
OniLink10
Posted: Jan 23 2009, 08:59 PM
Quote Post


C++ Programmer, Unofficial Physicist, and Unofficial Chemist
[*][*]

Group Icon
Group: Members
Posts: 3920
Member No.: 4907
Joined: 19-February 08

Status: (0d) [--]


QUOTE (Zero Kirby @ Jan 23 2009, 05:57 PM)
rule against posting Help topics in the CCC

Where?!

Oh wait, Rule 7. >_<

Strange, I see Help Threads in the CCC quite often.


--------------------
QUOTE (Xgoff @ Sep 10 2009 @ 06:11 PM)
did you try hello's engine

make sure to not ****ing change anything before using it!
PMEmail PosterUsers WebsiteYahoo
Top
United States
OniLink10
Posted: Jan 23 2009, 09:00 PM
Quote Post


C++ Programmer, Unofficial Physicist, and Unofficial Chemist
[*][*]

Group Icon
Group: Members
Posts: 3920
Member No.: 4907
Joined: 19-February 08

Status: (0d) [--]


QUOTE (Retriever II @ Jan 23 2009, 05:58 PM)
Erasing an element from a vector invalidates the iterator, because elements get shifted around to fill in the gaps you create.

Use the clear() method to empty your vector, or use the ranged version of the erase() function: iterator erase ( iterator first, iterator last );

http://www.cplusplus.com/reference/stl/vector/erase.html

Hmm, figures clear would work. I really should've thought this through before asking for help.


--------------------
QUOTE (Xgoff @ Sep 10 2009 @ 06:11 PM)
did you try hello's engine

make sure to not ****ing change anything before using it!
PMEmail PosterUsers WebsiteYahoo
Top
United States
Zero Kirby
Posted: Jan 23 2009, 09:01 PM
Quote Post


Well, your local psychic is off to visit your mother!
[*][*][*][*]

Group Icon
Group: Members
Posts: 6252
Member No.: 2501
Joined: 15-August 06

Status: (0d) [--]


QUOTE (OniLink10 @ Jan 23 2009, 06:59 PM)
Where?!

Oh wait, Rule 7. >_<

Strange, I see Help Threads in the CCC quite often.

Yes because everybody else is doing it and so can I

Sixteen year olds are smoking two years before they're legal and therefore so can I

Everybody else is going 60 in a 35 MPH zone and therefore so can I

Everybody's doing it, it can't possibly be wrong


--------------------
Falcon Punch is the result of the Sun heating fists. It drives the Blue Falcon. Heating causes destruction of water into the pain, where it then hurts, creating rain. Rain creates flowing water in tears, which can then be converted into other forms through more pain.

My Ref - Full Body Ref (minus the badass hat)

Visit Just Another Just Another Day - The Webcomic!

Super Mario Zero: Game Status (RAZZ Y U STEALING MAH FORMAT BRO)
Mario Object: Pretty much finished!
Enemy Objects: [||||||||--] Just gonna add Spinies, Bullet Bills and Cheep Cheeps!
Boss Fights: None in progress.
General Engine: [|||||||||-] Ranking System Complete! Gonna add pipes!
Levels Complete: [|---------] Haven't even finished the tutorial!
PMUsers WebsiteAOLMSN
Top
United States
Retriever II
Posted: Jan 23 2009, 09:02 PM
Quote Post


Catalyst
[H][*][*][*][*]
[*][*][*][*][*]


Group Icon
Group: Members
Posts: 18290
Member No.: 52
Joined: 13-October 03

Status: (0d) [--]


ITT we have sticks up our ass.


--------------------

PMEmail PosterUsers WebsiteICQAOLMSN
Top
United States
Medri Fogmatio
Posted: Jan 23 2009, 09:03 PM
Quote Post


Eradico tui vita iassu imperium Erus per Tempus.
[*][*]

Group Icon
Group: Members
Posts: 715
Member No.: 1313
Joined: 29-July 05

Status: (0d) [--]


This is CCC not C++

Just PM one of them.


--------------------

Pokemon Platinum Team:

| 4554 - 6095 - 0626 | - Cale
__________________________
Pokemon Diamond Team:

| 1461 - 3023 - 6380 | - Medri
Wii Code: 3907-5198-1973-4586 | Medri

PMEmail PosterAOLYahooMSN
Top
Unspecified
Raie
Posted: Jan 23 2009, 09:03 PM
Quote Post


It's called L-targeting
[*][*]

Group Icon
Group: IRC Operators
Posts: 8497
Member No.: 2990
Joined: 26-November 06

Status: (0d) [--]


QUOTE (Zero Kirby @ Jan 23 2009, 07:01 PM)
Yes because everybody else is doing it and so can I

Sixteen year olds are smoking two years before they're legal and therefore so can I

Everybody else is going 60 in a 35 MPH zone and therefore so can I

Everybody's doing it, it can't possibly be wrong

Take a deep breath


--------------------
Do the time warp

user posted image
PMEmail Poster
Top
Canada
MegaTailzChao
Posted: Jan 23 2009, 09:04 PM
Quote Post


So long, and thanks for all the fish.
[S][*][*][*][*]
[*][*]

Group Icon
Group: Site Staff
Posts: 15788
Member No.: 2267
Joined: 2-July 06

Status: (0d) [--]


QUOTE (Medri Fogmatio @ Jan 23 2009, 07:03 PM)
This is CCC not C++

Just PM one of them.

dohohohoho


--------------------
user posted image
user posted imageuser posted image
PMEmail PosterMSN
Top
United States
Zero Kirby
Posted: Jan 23 2009, 09:05 PM
Quote Post


Well, your local psychic is off to visit your mother!
[*][*][*][*]

Group Icon
Group: Members
Posts: 6252
Member No.: 2501
Joined: 15-August 06

Status: (0d) [--]


QUOTE (Raie @ Jan 23 2009, 07:03 PM)
Take a deep breath

No, the sixteen year olds I'm driving with are smoking and if I breathe it in I could choke and crash because I'm busy blazing through town at 60 MPH


--------------------
Falcon Punch is the result of the Sun heating fists. It drives the Blue Falcon. Heating causes destruction of water into the pain, where it then hurts, creating rain. Rain creates flowing water in tears, which can then be converted into other forms through more pain.

My Ref - Full Body Ref (minus the badass hat)

Visit Just Another Just Another Day - The Webcomic!

Super Mario Zero: Game Status (RAZZ Y U STEALING MAH FORMAT BRO)
Mario Object: Pretty much finished!
Enemy Objects: [||||||||--] Just gonna add Spinies, Bullet Bills and Cheep Cheeps!
Boss Fights: None in progress.
General Engine: [|||||||||-] Ranking System Complete! Gonna add pipes!
Levels Complete: [|---------] Haven't even finished the tutorial!
PMUsers WebsiteAOLMSN
Top
United States
OniLink10
Posted: Jan 23 2009, 09:06 PM
Quote Post


C++ Programmer, Unofficial Physicist, and Unofficial Chemist
[*][*]

Group Icon
Group: Members
Posts: 3920
Member No.: 4907
Joined: 19-February 08

Status: (0d) [--]


QUOTE (Medri Fogmatio @ Jan 23 2009, 06:03 PM)
This is CCC not C++

Just PM one of them.

In case you didn't notice, this was solved.


--------------------
QUOTE (Xgoff @ Sep 10 2009 @ 06:11 PM)
did you try hello's engine

make sure to not ****ing change anything before using it!
PMEmail PosterUsers WebsiteYahoo
Top
United States
OniLink10
Posted: Jan 23 2009, 09:06 PM
Quote Post


C++ Programmer, Unofficial Physicist, and Unofficial Chemist
[*][*]

Group Icon
Group: Members
Posts: 3920
Member No.: 4907
Joined: 19-February 08

Status: (0d) [--]


QUOTE (Zero Kirby @ Jan 23 2009, 06:01 PM)
Yes because everybody else is doing it and so can I

Sixteen year olds are smoking two years before they're legal and therefore so can I

Everybody else is going 60 in a 35 MPH zone and therefore so can I

Everybody's doing it, it can't possibly be wrong

I meant, all those people who break Rule 7 never get warned.

So I'm wondering if the Mods even enforce Rule 7 outside of CCC.

This post has been edited by OniLink10 on Jan 23 2009, 09:07 PM


--------------------
QUOTE (Xgoff @ Sep 10 2009 @ 06:11 PM)
did you try hello's engine

make sure to not ****ing change anything before using it!
PMEmail PosterUsers WebsiteYahoo
Top
Unspecified
Raie
Posted: Jan 23 2009, 09:07 PM
Quote Post


It's called L-targeting
[*][*]

Group Icon
Group: IRC Operators
Posts: 8497
Member No.: 2990
Joined: 26-November 06

Status: (0d) [--]


QUOTE (Zero Kirby @ Jan 23 2009, 07:05 PM)
No, the sixteen year olds I'm driving with are smoking and if I breathe it in I could choke and crash because I'm busy blazing through town at 60 MPH

Okay, hold your breath and count to 1000. Backwards. Skipping every 16th number.


--------------------
Do the time warp

user posted image
PMEmail Poster
Top
Canada
MegaTailzChao
Posted: Jan 23 2009, 09:07 PM
Quote Post


So long, and thanks for all the fish.
[S][*][*][*][*]
[*][*]

Group Icon
Group: Site Staff
Posts: 15788
Member No.: 2267
Joined: 2-July 06

Status: (0d) [--]


QUOTE (OniLink10 @ Jan 23 2009, 07:06 PM)
I meant, all those people who break Rule 7 never get warned.

So I'm wondering if the Mods even enforce Rule 7 outside of CCC.

AND SO THE LOOP BEGINS


--------------------
user posted image
user posted imageuser posted image
PMEmail PosterMSN
Top
United States
OniLink10
Posted: Jan 23 2009, 09:08 PM
Quote Post


C++ Programmer, Unofficial Physicist, and Unofficial Chemist
[*][*]

Group Icon
Group: Members
Posts: 3920
Member No.: 4907
Joined: 19-February 08

Status: (0d) [--]


99% Chance this thread will be derailed in a few posts.

Oh wait, it already was.


--------------------
QUOTE (Xgoff @ Sep 10 2009 @ 06:11 PM)
did you try hello's engine

make sure to not ****ing change anything before using it!
PMEmail PosterUsers WebsiteYahoo
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

  Topic Options Topic Options Pages: (3) [1] 2 3  Closed TopicStart new topicStart Poll

 




[ Script Execution time: 0.0933 ]   [ 14 queries used ]   [ GZIP Enabled ]   [ Server Load: 0.21 ]