Author |
Message |
Pests Novice
Joined: Feb 24 2003 Posts: 84 Offline
|
Posted: Sun Jun 20, 2004 11:50 pm Post maybe stupid Post subject: Trying to learn to code better |
 |
|
|
|
Hi, I've really been trying to code better recently, but I feel I'm not useing MSVC6 correctly or to its fullest potential. Could someone direct me where I could learn more about it or someone teach me? For example, the only things I really ever do is run the program, and fix any bugs that come up. I'm sure theres better ways out there then to guess and check whats wrong and how to fix, ect. Like, I hear talk of break points and all the good things, but I don't know how to use them. |
|
Back to top |
|
 |
CypherJF I gargle nitroglycerin

Gender: Joined: Aug 14 2003 Posts: 2582 Location: USA Offline
|
Posted: Mon Jun 21, 2004 12:27 am Post maybe stupid Post subject: |
 |
|
|
|
Not really, other than learn the language well; then while learning hopefully you'll learn how to debug well.
www.cplusplus.com _________________ Performance is often the art of cheating carefully. - James Gosling |
|
Back to top |
|
 |
Mr Ekted Movie Geek

Gender: Joined: Feb 09 2004 Posts: 1379 Offline
|
|
Back to top |
|
 |
50% Packetloss Server Help Squatter

Age:40 Gender: Joined: Sep 09 2003 Posts: 561 Location: Santa Clarita, California Offline
|
Posted: Mon Jun 21, 2004 4:05 am Post maybe stupid Post subject: |
 |
|
|
|
Pick up a book, browse through the stuff that you think you know and check out anything that looks new. Maybe sign up for a class to teach you a lower level language.
I believe i got the answer, translated it into hex so i didnt spoil it for anyone else
23696E636C756465203C737464696F2E683ED0A0696E74206D61696E2829D0A07768696C6520282A702920D0A072657475726E20303B00
http://nickciske.com/tools/hex.php |
|
Back to top |
|
 |
CypherJF I gargle nitroglycerin

Gender: Joined: Aug 14 2003 Posts: 2582 Location: USA Offline
|
Posted: Mon Jun 21, 2004 4:07 am Post maybe stupid Post subject: |
 |
|
|
|
Good idea  |
|
Back to top |
|
 |
Dustpuppy Server Help Squatter

Age:40 Gender: Joined: Jan 23 2003 Posts: 215 Location: England Offline
|
Posted: Mon Jun 21, 2004 6:10 am Post maybe stupid Post subject: |
 |
|
|
|
I'd say one of your bugs is correct but the others are pretty irrelevant. Besides Ekted said there were 2 bugs and you gave 3
I think the remaining bug will be fairly obvious if you run it after finding the first one. _________________
 |
|
Back to top |
|
 |
Mine GO BOOM Hunch Hunch What What

Age:42 Gender: Joined: Aug 01 2002 Posts: 3615 Location: Las Vegas Offline
|
Posted: Mon Jun 21, 2004 11:18 am Post maybe stupid Post subject: |
 |
|
|
|
Main does not need to be an int. And if it does, you are not required to have a return 0 at the end, as it is implied. These are somewhat recent changes, but I read about them somewhere when someone whined that GCC no longer prints warnings or errors or something whenever they don't have the return 0 statement.
I would google more for answers, but the main function is special, and having it be void, or int without a return statement, is perfectly legitimate.
EDIT: Bah, I'm not one to go without googling for answers. Here, read this. |
|
Back to top |
|
 |
Mr Ekted Movie Geek

Gender: Joined: Feb 09 2004 Posts: 1379 Offline
|
Posted: Mon Jun 21, 2004 3:01 pm Post maybe stupid Post subject: |
 |
|
|
|
50% you missed one of the real bugs...  |
|
Back to top |
|
 |
Bak ?ls -s 0 in

Age:26 Gender: Joined: Jun 11 2004 Posts: 1826 Location: USA Offline
|
Posted: Mon Jun 21, 2004 3:05 pm Post maybe stupid Post subject: |
 |
|
|
|
23696E636C7564652022737464696F2E6822D0A0D0A0766F6964206D6169
6E20282920D0A07B20D0A09063686172202A70203D20227468697320697
3206120737472696E67223B20D0A09063686172202A713B20D0A09063686
17220206275665B36345D3B20D0A0D0A09071203D206275663B20D0A0D
0A0907768696C6520282A7029D0A0907BD0A090902A712B2B203D202A7
02B2B3B20D0A0907DD0A0902A71203D20303BD0A0D0A0907072696E746
6282254686520627566666572203D2025735C6E222C20627566293B20D0
A07D00
http://nickciske.com/tools/hex.php |
|
Back to top |
|
 |
Mr Ekted Movie Geek

Gender: Joined: Feb 09 2004 Posts: 1379 Offline
|
Posted: Mon Jun 21, 2004 4:42 pm Post maybe stupid Post subject: |
 |
|
|
|
Good  |
|
Back to top |
|
 |
Cyan~Fire I'll count you!

Age:37 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Tue Jun 22, 2004 1:27 pm Post maybe stupid Post subject: |
 |
|
|
|
OK, I got the "first" bug just by looking at it, but not the second. I seem to think for some reason that arrays are automatically zeroed? _________________ This help is informational only. No representation is made or warranty given as to its content. User assumes all risk of use. Cyan~Fire assumes no responsibility for any loss or delay resulting from such use.
Wise men STILL seek Him. |
|
Back to top |
|
 |
Mr Ekted Movie Geek

Gender: Joined: Feb 09 2004 Posts: 1379 Offline
|
Posted: Tue Jun 22, 2004 3:12 pm Post maybe stupid Post subject: |
 |
|
|
|
Nothing happens without code.
In VC debugger, all uninitialized stack space and allocated space are filled with specific bytes, so if you have a bug and notice this particular byte, it's a clue that something is uninitialized. Freed memory is filled with a different byte, so it's easier to tell when you are still referencing freed memory. |
|
Back to top |
|
 |
|