Thread: Useful program

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Deleting... VOX's Avatar
    Join Date
    Oct 2004
    Location
    VA
    Posts
    94

    Useful program

    Here is a little program I made that displays ascii key codes. It can display the full listing, a designated number of codes, or a single code. Great for when you need to know a code for something real fast. If you think I should make any changes to it tell me.
    Boy you stink, go take a shower before you continue to code. Better do your laundry and spray your chair too.

    The one and only resource for finding information.

    Next version of windows released!!!!

  2. #2
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    Post source code.

  3. #3
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    My mommy told me never to accept executables from strangers.

  4. #4
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    I have neither the time nor the inclination to disassemble your program and make sure that it's safe. The program doesn't sound that enticing either, so you'll need to post some code to attract my interest.
    My best code is written with the delete key.

  5. #5
    ---
    Join Date
    May 2004
    Posts
    1,379
    Here is a little program I made that displays ascii key codes.
    Just what I always wanted! I was wondering when someone was going to write something as useful as this!

  6. #6
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Well you know Christmas is coming around soon and all.

  7. #7
    Deleting... VOX's Avatar
    Join Date
    Oct 2004
    Location
    VA
    Posts
    94
    Why would I give you all something that would harm your PC? Here is the source code but it's nothing special.
    Boy you stink, go take a shower before you continue to code. Better do your laundry and spray your chair too.

    The one and only resource for finding information.

    Next version of windows released!!!!

  8. #8
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    We distrust everyone. Plus no one learns from the executable

    Edit: Speaking of learning:
    Things I see wrong without even thinking
    Code:
    #include <conio.h>
    Non standard header
    Code:
    void main()
    Main returns an int
    Code:
    printf("%c %i\n",c,c);
    1) Not every machine uses ASCII so this won't print the ASCII table correctly on all machines
    2) c is an int, you are passing an int when you should be passing a char for the first type specifier
    Code:
    gets(code);
    THERE IS NO EXCUSE FOR gets() EVER!


    See this is why we ask for the source. Had my computer ran this it would have kicked me.
    Last edited by Thantos; 12-19-2004 at 07:26 PM.

  9. #9
    Deleting... VOX's Avatar
    Join Date
    Oct 2004
    Location
    VA
    Posts
    94
    Did I ask for your comments on my code? No. Did I say it was flawless 150% correct code? No! You don't need include files for the program to work, so it doesn't matter what header you use. If it does't work right for you then you can't use it. Unless you are on purpose going to overflow gets with jargon then it doesn't matter to me what input function you use. I made it for convenience so if you don't like it, don't use it. Very simple. Go look your codes up in a book if you hate it so much.

    I use it all the time and it does it's job well. In my opinion it is very immature for someone to immediately pick at every little thing in someone's code. Go make your own ascii viewer.
    Last edited by VOX; 12-19-2004 at 07:36 PM.
    Boy you stink, go take a shower before you continue to code. Better do your laundry and spray your chair too.

    The one and only resource for finding information.

    Next version of windows released!!!!

  10. #10
    Registered User
    Join Date
    Jun 2003
    Posts
    361
    My ascii viewer: www.asciitable.com

    If you stop being so offended VOX, you can learn quite a bit from the suggestions that Thantos gave. It's not "picking" on you, it's education. It goes a bit beyond putting something together quickly for convenience. Unexpected behaviour has never been too "convenient" for me. There are some issues with the code that, if improved upon, will provide a much more stable and share-worthy program.

  11. #11
    Deleting... VOX's Avatar
    Join Date
    Oct 2004
    Location
    VA
    Posts
    94
    Maybe you are right, but I don't see anything wrong with void main and including the conio.h header. I'll try to change the gets.
    Boy you stink, go take a shower before you continue to code. Better do your laundry and spray your chair too.

    The one and only resource for finding information.

    Next version of windows released!!!!

  12. #12
    Registered User
    Join Date
    Jun 2003
    Posts
    361
    The FAQ and this site can explain "void main" better than I can.

  13. #13
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    And as for conio.h, the only problem is that it's non-standard. If you're distributing a commercial application, that's not a problem. If you're in a situation where you'd be required to provide source code, such as a forum or open-source project, expect to get flak, as people aren't guaranteed to be able to compile it.

    Don't get offended by such criticism. What Thantos wrote was clearly written with the intention of helping you become a better programmer.

  14. #14
    UT2004 Addict Kleid-0's Avatar
    Join Date
    Dec 2004
    Posts
    656
    Quote Originally Posted by sean_mackrory
    And as for conio.h, the only problem is that it's non-standard. If you're distributing a commercial application, that's not a problem.
    I think all noobs shouldn't follow this rule, because a lot of rules makes programming really distasteful. Don't do THIS, do THAT, and then I get confused and I get depressed! Sometimes people who say: "Don't do this!" that don't even supply the solution for what to use without it. And that's ok, but it gets intense! It's hard being a learner :'(

  15. #15
    Registered User
    Join Date
    Sep 2004
    Posts
    719
    Quote Originally Posted by Kleid-0
    I think all noobs shouldn't follow this rule, because a lot of rules makes programming really distasteful. Don't do THIS, do THAT, and then I get confused and I get depressed! Sometimes people who say: "Don't do this!" that don't even supply the solution for what to use without it. And that's ok, but it gets intense! It's hard being a learner :'(

    i honestly appreciate people pointing out my mistakes and potential mistakes and why they are mistakes..i learn twice as much from one mistake than reading one chapter in "teach yourself c in16 seconds" or whatever my chosen text shall be....however, if someone does point out a mistake, but it's unrelated to my original problem and they offer no help with the original problem (or saying they don't know), then it does seem like nit picking...i understand though...but most noobs probably do not
    i seem to have GCC 3.3.4
    But how do i start it?
    I dont have a menu for it or anything.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Issue with program that's calling a function and has a loop
    By tigerfansince84 in forum C++ Programming
    Replies: 9
    Last Post: 11-12-2008, 01:38 PM
  2. Need help with a program, theres something in it for you
    By engstudent363 in forum C Programming
    Replies: 1
    Last Post: 02-29-2008, 01:41 PM
  3. Replies: 4
    Last Post: 02-21-2008, 10:39 AM
  4. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 10:04 PM