im the biggest noob ever and i need mad help (shuld be easY)

Ask for help with your homework/assignments in this forum!

Moderators: Darobat, RecursiveS, Dante Shamest, Bugdude, Wizard

Re

Postby Dudi Hatotah » Fri Oct 10, 2003 8:03 pm

Ummmmm...
Shouldn't it be:
Code: Select all
double total = 100-(4.98*seconds*seconds);


Or did you make that mistake on purpose?...
User avatar
Dudi Hatotah
 
Posts: 222
Joined: Fri Oct 03, 2003 4:17 pm
Location: Micronesia, the island of Yap

Postby Tracer » Sat Oct 11, 2003 12:45 am

Someone should code one for him that randomly and "accidently" overwrites random areas of memory... :D :shock:
(C++ TotalNewB)

if(!die(self));
self++;
User avatar
Tracer
 
Posts: 124
Joined: Wed Oct 08, 2003 4:07 am

Postby omnius » Sat Oct 11, 2003 7:10 am

Tracer wrote:Someone should code one for him that randomly and "accidently" overwrites random areas of memory... :D :shock:

Most noob programs do that :?
omnius
 
Posts: 496
Joined: Wed Sep 24, 2003 12:03 pm

Postby MXP » Sat Oct 11, 2003 3:34 pm

Whoops!

Code: Select all
int oopsies[2];

for (int i = 0;; i++)
    oopsies[i] = 0x6358ff;
Need information on a function I've posted? Chances are it's at the MSDN.
MXP
 
Posts: 6506
Joined: Mon Sep 22, 2003 5:27 pm

Postby Justin » Sat Oct 11, 2003 8:33 pm

i don't know what the hex code does, but I know an infinit loop into memory hell when i see one. :twisted:
User avatar
Justin
 
Posts: 158
Joined: Tue Sep 30, 2003 10:07 am
Location: CA

Postby omnius » Sun Oct 12, 2003 7:40 am

Justin wrote:i don't know what the hex code does, but I know an infinit loop into memory hell when i see one. :twisted:

Why an infinite loop?

for (int i = 0;; i++)

Disregrading the rest of the loop, this isn't guaranteed to be an infinite loop. The value of i will increment with each iteration until it reaches the value INT_MAX. Incrementing beyond that results in undefined behaviour.
omnius
 
Posts: 496
Joined: Wed Sep 24, 2003 12:03 pm

Postby Justin » Sun Oct 12, 2003 2:34 pm

In most cases, an int will "wrap" back to its lowest value if it is incremented past its max. but ya, it's undefined.
User avatar
Justin
 
Posts: 158
Joined: Tue Sep 30, 2003 10:07 am
Location: CA

Previous

Return to Homeworks

Who is online

Users browsing this forum: Google [Bot] and 1 guest