MajorGeeks Support Forums

Go Back   MajorGeeks Support Forums > ----------= Welcome =---------- > The Lounge
Register FAQ Members List Calendar Casino Mark Forums Read

The Lounge Hang out and have some fun with your fellow Majorgeeks!


Reply
 
Thread Tools Display Modes
  #1  
Old 01-22-05, 12:18
goldfish's Avatar
goldfish goldfish is offline
Lt. Sushi.DC
 
Join Date: Jun 2002
Location: UK
Posts: 7,137
Thanks: 0
Thanked 3 Times in 3 Posts
Default The last ever C programming mistake

if (authorisation = "yes") {
launchmissiles();
}

__________________
(`._.[ G|Fh ]._.) Folding@Geeks, TEAM 12072 http://www.majorgeeks.com/page.php?id=9
Reply With Quote
Sponsored links
  #2  
Old 01-22-05, 13:14
goldfish's Avatar
goldfish goldfish is offline
Lt. Sushi.DC
 
Join Date: Jun 2002
Location: UK
Posts: 7,137
Thanks: 0
Thanked 3 Times in 3 Posts
Default Re: The last ever C programming mistake

Anyone find the problem yet?
__________________
(`._.[ G|Fh ]._.) Folding@Geeks, TEAM 12072 http://www.majorgeeks.com/page.php?id=9
Reply With Quote
  #3  
Old 01-22-05, 13:16
scorcer scorcer is offline
ajMro keGe
 
Join Date: Nov 2004
Posts: 2,185
Thanks: 49
Thanked 16 Times in 13 Posts
Default Re: The last ever C programming mistake

the answer is "epswiche clams"


no??, is it the spelling of authoriZation??
Reply With Quote
  #4  
Old 01-22-05, 13:24
NeoNemesis's Avatar
NeoNemesis NeoNemesis is offline
Moutharrhea
 
Join Date: Jul 2004
Location: Western NY
Posts: 2,528
Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: The last ever C programming mistake

Im gonna go with, theres no 'else' so wouldn't it do the launchmissles() no matter what?
Reply With Quote
  #5  
Old 01-22-05, 13:25
goldfish's Avatar
goldfish goldfish is offline
Lt. Sushi.DC
 
Join Date: Jun 2002
Location: UK
Posts: 7,137
Thanks: 0
Thanked 3 Times in 3 Posts
Default Re: The last ever C programming mistake

Nope

spelling means nothing, and I'm english so i spell it authorisation
__________________
(`._.[ G|Fh ]._.) Folding@Geeks, TEAM 12072 http://www.majorgeeks.com/page.php?id=9
Reply With Quote
Sponsored links
  #6  
Old 01-22-05, 13:34
mcadam's Avatar
mcadam mcadam is offline
Major Amnesia
 
Join Date: Jun 2004
Location: London, UK
Posts: 5,214
Thanks: 18
Thanked 64 Times in 52 Posts
Default Re: The last ever C programming mistake

spaces between authorisation and = sign??
__________________
An amateur will practice until they get it right.
A professional will practice until they don't get it wrong.
Reply With Quote
  #7  
Old 01-22-05, 13:35
goldfish's Avatar
goldfish goldfish is offline
Lt. Sushi.DC
 
Join Date: Jun 2002
Location: UK
Posts: 7,137
Thanks: 0
Thanked 3 Times in 3 Posts
Default Re: The last ever C programming mistake

nope, but closer
__________________
(`._.[ G|Fh ]._.) Folding@Geeks, TEAM 12072 http://www.majorgeeks.com/page.php?id=9
Reply With Quote
  #8  
Old 01-22-05, 13:37
NeoNemesis's Avatar
NeoNemesis NeoNemesis is offline
Moutharrhea
 
Join Date: Jul 2004
Location: Western NY
Posts: 2,528
Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: The last ever C programming mistake

no 'then' so the launchmissles() would be separate from the 'if'.


not sure seeing as how i don't know c
Reply With Quote
  #9  
Old 01-22-05, 13:39
jarcher's Avatar
jarcher jarcher is offline
I can't handle a title
 
Join Date: Jun 2004
Location: in morbid fear
Posts: 3,758
Thanks: 0
Thanked 2 Times in 2 Posts
Default Re: The last ever C programming mistake

Quote:
Originally Posted by goldfish
if (authorisation = "yes") {
launchmissiles();
}

I don't know a thing about programing, or spelling for that matter
but i would say that
authorisation= launchmissles
Reply With Quote
  #10  
Old 01-22-05, 13:46
MrPewty's Avatar
MrPewty MrPewty is offline
Major Geek
 
Join Date: Jul 2002
Location: Central Alberta
Posts: 1,434
Thanks: 15
Thanked 6 Times in 5 Posts
Default Re: The last ever C programming mistake

The Brackets? I seem to remember those brackets hiding text in Pascal, but that was 15 years ago, and I haven't done any programming since. Never did C.
Reply With Quote
Sponsored links
  #11  
Old 01-22-05, 13:47
NeoNemesis's Avatar
NeoNemesis NeoNemesis is offline
Moutharrhea
 
Join Date: Jul 2004
Location: Western NY
Posts: 2,528
Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: The last ever C programming mistake

im gonna go with you, now that i think about it. WHen I did c++, I never used parenthesis. Heck, neither in basic too.
Reply With Quote
  #12  
Old 01-22-05, 14:01
MrPewty's Avatar
MrPewty MrPewty is offline
Major Geek
 
Join Date: Jul 2002
Location: Central Alberta
Posts: 1,434
Thanks: 15
Thanked 6 Times in 5 Posts
Default Re: The last ever C programming mistake

Quote:
Originally Posted by MrPewty
The Brackets? I seem to remember those brackets hiding text in Pascal, but that was 15 years ago, and I haven't done any programming since. Never did C.
That would be the curly brackets around launchmissles();



Hmmm. Now that I think back, maybe it was * * that hid text.

Maybe the ";" is in the wrong place, not being on the end of the line(after the last bracket).

Maybe I'm rambling...
Reply With Quote
  #13  
Old 01-22-05, 15:08
Phantom's Avatar
Phantom Phantom is offline
Brigadier Britches
 
Join Date: Jan 2002
Location: The Jungle
Posts: 5,449
Thanks: 287
Thanked 431 Times in 363 Posts
Default Re: The last ever C programming mistake

if (authorisation = "yes") {(launchmissiles)};


Makes more sense to me. Then again, I'm not a programmer. ::
__________________
The smallest act of kindness is worth more than the grandest intention.
Reply With Quote
  #14  
Old 01-22-05, 16:17
goldfish's Avatar
goldfish goldfish is offline
Lt. Sushi.DC
 
Join Date: Jun 2002
Location: UK
Posts: 7,137
Thanks: 0
Thanked 3 Times in 3 Posts
Default Re: The last ever C programming mistake

nope, launchmissiles() is a perfectly normal bit of code.

You're not gunna get it, unless Kodo comes along all of a sudden

SPOILER:














its the authorisaton="yes" part. when you are comparing two values, you use ==, !=, >, < .... the = charachter signifies the operation of setting a variable. That condition says that if (set authorisation to yes) works correctly, then... So, prodvided the variable can be set, it will always return true, regardless of what authorisation was to start with.
__________________
(`._.[ G|Fh ]._.) Folding@Geeks, TEAM 12072 http://www.majorgeeks.com/page.php?id=9
Reply With Quote
  #15  
Old 01-22-05, 18:46
Maxwell's Avatar
Maxwell Maxwell is offline
Folgers
 
Join Date: Apr 2003
Location: Wiltshire, UK
Posts: 1,211
Thanks: 11
Thanked 34 Times in 31 Posts
Default Re: The last ever C programming mistake

I knew that but didn't see your first post until after you posted the answer, honest!

Here are some other real-life software catstrophic failures:
http://www5.in.tum.de/~huckle/bugse.html

see also: http://forums.majorgeeks.com/showthr...562#post507562
__________________
...when you have excluded the impossible, whatever remains, however improbable, must be the truth.
Reply With Quote
Sponsored links
  #16  
Old 01-22-05, 21:48
evilevets's Avatar
evilevets evilevets is offline
Command Sergeant Major
 
Join Date: Aug 2004
Location: Philly, PA
Posts: 886
Thanks: 0
Thanked 1 Time in 1 Post
Default Re: The last ever C programming mistake

() is going to launch missiles regardless?


Steve
__________________
LIVE + LOVE + BURN + DIE

"We All Look The Same...But I Am The Killer"
Reply With Quote
  #17  
Old 01-23-05, 09:47
goldfish's Avatar
goldfish goldfish is offline
Lt. Sushi.DC
 
Join Date: Jun 2002
Location: UK
Posts: 7,137
Thanks: 0
Thanked 3 Times in 3 Posts
Default Re: The last ever C programming mistake

No, (authorisation = yes) makes authorisation equal to yes, rather than checking if it equals yes or not. To check it, it needs to be if (authorisation == yes).
__________________
(`._.[ G|Fh ]._.) Folding@Geeks, TEAM 12072 http://www.majorgeeks.com/page.php?id=9
Reply With Quote
  #18  
Old 01-23-05, 09:54
NeoNemesis's Avatar
NeoNemesis NeoNemesis is offline
Moutharrhea
 
Join Date: Jul 2004
Location: Western NY
Posts: 2,528
Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: The last ever C programming mistake

ahhh, in C++ I used to spend hours trying to figure out what I was going wrong, turned out to be just that.
Reply With Quote
  #19  
Old 01-23-05, 10:00
NeoNemesis's Avatar
NeoNemesis NeoNemesis is offline
Moutharrhea
 
Join Date: Jul 2004
Location: Western NY
Posts: 2,528
Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: The last ever C programming mistake

I'm learning a bit of PHP and this seems like it would catch quite a few people. So whats wrong with this one?

$blah = "Hello";
print ('$blah and Welcome');

Goldfish, stay outta this one!
Reply With Quote
  #20  
Old 01-23-05, 10:18
animatorStrike's Avatar
animatorStrike animatorStrike is offline
 
Join Date: Sep 2004
Location: Menifee, California
Posts: 494
Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: The last ever C programming mistake

You don't use print in PHP. You use echo...or at least I think so. And, you don't need to put the variable in the (). This is how I think it should be:

$blah = "Hello";
echo $blah (' and Welcome');
__________________
www.chrisesselborn.tk
Reply With Quote
Sponsored links
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 05:41.

MajorGeeks.Com Menu

MajorGeeks.Com \ All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ NEW! PC Games \ System Tools \ Macintosh \ Demonews.Com \ Top Downloads

MajorGeeks.Com \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds


Powered by vBulletin® Version 3.8.4
Copyright © 2009 vBulletin Solutions, Inc. All rights reserved.
Ad Management by RedTyger