Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Mar 17th, 2008, 8:57 PM   #21
Jimbo
Battle Programmer
 
Jimbo's Avatar
 
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 754
Rep Power: 3 Jimbo is on a distinguished road
Re: 500 Ways to Cause An Error

Fun defining classes (I didn't verify with a compiler that I got this error wrong, forgive me):
A.h:
cpp Syntax (Toggle Plain Text)
  1. #pragma once
  2. // The preceding is a VS macro, shut up :P
  3. #include "B.h"
  4.  
  5. class A
  6. {
  7. B* b;
  8. };
B.h:
cpp Syntax (Toggle Plain Text)
  1. #pragma once
  2.  
  3. #include "A.h"
  4.  
  5. class B
  6. {
  7. A* a;
  8. };
whatfun.cpp:
cpp Syntax (Toggle Plain Text)
  1. #include "A.h"
  2. #include "B.h"
  3.  
  4. int main()
  5. {
  6. A a;
  7. B b;
  8. }
__________________
<insert disclaimer here>
<insert shameless plug for Visual Studio here>
Jimbo is offline   Reply With Quote
Old Mar 18th, 2008, 5:50 AM   #22
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 1,835
Rep Power: 5 Sane will become famous soon enough
Send a message via MSN to Sane
Re: 500 Ways to Cause An Error

Quote:
Originally Posted by Jimbo View Post
Quote:
Originally Posted by Sane View Post
14) C

C Syntax (Toggle Plain Text)
  1. // Compile The Following Line
  2. // Compile The Previous Line

Fail! Does not meet the criteria (compile error, runtime error, or general potential to cause havoc).
ErrorCount--;
(can I take #14, since ErrorCount is as yet undefined? )
I get:

[Linker error] undefined reference to `WinMain@16' 
ld returned 1 exit status

Is that not a compile error?
Sane is offline   Reply With Quote
Old Mar 18th, 2008, 9:30 AM   #23
glimmy
Programmer
 
glimmy's Avatar
 
Join Date: May 2005
Location: Minnesota
Posts: 42
Rep Power: 0 glimmy is on a distinguished road
Send a message via AIM to glimmy
Re: 500 Ways to Cause An Error

16) Arc

lisp Syntax (Toggle Plain Text)
  1. (def function ()
  2. (cons 1 (function)))

Consing is (or should be) a fairly expensive operation for memory.
glimmy is offline   Reply With Quote
Old Mar 18th, 2008, 10:59 AM   #24
RainMan
Newbie
 
Join Date: Mar 2008
Posts: 7
Rep Power: 0 RainMan is on a distinguished road
Re: 500 Ways to Cause An Error

java Syntax (Toggle Plain Text)
  1. 17) Java
  2.  
  3. Array error[]= new Array[ 3 ];
  4. error[1] = new ....
  5. error[2] = new....
  6. error[3]= new....
causes a java main thread exception error

Last edited by RainMan; Mar 18th, 2008 at 11:08 AM. Reason: changing script to use code tags
RainMan is offline   Reply With Quote
Old Mar 18th, 2008, 11:00 AM   #25
RainMan
Newbie
 
Join Date: Mar 2008
Posts: 7
Rep Power: 0 RainMan is on a distinguished road
Re: 500 Ways to Cause An Error

if the array is defined in the main method
RainMan is offline   Reply With Quote
Old Mar 18th, 2008, 12:23 PM   #26
L7Sqr
Hobbyist Programmer
 
Join Date: Jun 2005
Location: here
Posts: 124
Rep Power: 0 L7Sqr is an unknown quantity at this point
Re: 500 Ways to Cause An Error

18) Introduce it to management
(This *definitely* qualifies under: 'general potential to cause havoc')
__________________
"...and though our kids are blessed their parents let them shoulder all the blame."
- The Quiet Things That No One Ever Knows [BrandNew]
L7Sqr is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Basic Socket Programming Error in Linux.. Pls help boraciner C++ 18 Sep 12th, 2007 1:17 AM
C# corruption!!! Kilo C++ 32 May 21st, 2006 8:44 PM
Masm rsnd Assembly 4 May 20th, 2006 9:05 PM
libraries matko C 1 Jan 22nd, 2006 2:12 PM
String error in if statement Blighttdm C 12 Nov 18th, 2005 6:34 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 3:51 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC