View Poll Results: do you like it?

Voters
2. You may not vote on this poll
  • yes

    2 100.00%
  • hmm

    0 0%
  • no

    0 0%

Thread: suggestions : encode / decode header + documentation

  1. #1
    Registered User
    Join Date
    Jan 2003
    Posts
    56

    suggestions : encode / decode header + documentation

    hi,
    i just finished my encode / decode header,
    in bottom of main.cpp theres a function overview.
    any feedback is welcome

    btw: just finished tutorial on object orientated programmign so this is first attempt to object orientated programing

    edit : updated .h file

    thx for the tip ;-)
    Last edited by gamer; 11-21-2004 at 05:17 AM.
    if x == y , y == x

  2. #2
    Registered User manofsteel972's Avatar
    Join Date
    Mar 2004
    Posts
    317
    one possible suggestion if you want to eliminate all those if statements is to condense it and compare it to a string;
    Code:
    char alphabet[]={"abcdefghijklmnopqrstuvwxyzABCDEF!@#$"};
    int i=0;
    while(alphabet[i]!='\0')
    {
        if(letter2000==alphabet[i])
        {
            letter2004=i;
        }
        
        i++;
    }
    this would make it easier to add Capital letters or other symbols
    "Knowledge is proud that she knows so much; Wisdom is humble that she knows no more."
    -- Cowper

    Operating Systems=Slackware Linux 9.1,Windows 98/Xp
    Compilers=gcc 3.2.3, Visual C++ 6.0, DevC++(Mingw)

    You may teach a person from now until doom's day, but that person will only know what he learns himself.

    Now I know what doesn't work.

    A problem is understood by solving it, not by pondering it.

    For a bit of humor check out xkcd web comic http://xkcd.com/235/

  3. #3
    Registered User
    Join Date
    Jan 2003
    Posts
    56
    hmm whats the \0 ?? i dont get that still not that good in c++
    if x == y , y == x

  4. #4
    Registered User manofsteel972's Avatar
    Join Date
    Mar 2004
    Posts
    317
    C-Style strings are termintated with a NULL character '\0'. Basically the loop it just testing to see if it has hit the end of the string. You can think of it like this.
    If you have ever had to climb a rope most people tie a big knot at the end of it. That way they have someting to stop them from slding off the rope.
    "Knowledge is proud that she knows so much; Wisdom is humble that she knows no more."
    -- Cowper

    Operating Systems=Slackware Linux 9.1,Windows 98/Xp
    Compilers=gcc 3.2.3, Visual C++ 6.0, DevC++(Mingw)

    You may teach a person from now until doom's day, but that person will only know what he learns himself.

    Now I know what doesn't work.

    A problem is understood by solving it, not by pondering it.

    For a bit of humor check out xkcd web comic http://xkcd.com/235/

  5. #5
    Registered User
    Join Date
    Jan 2003
    Posts
    56
    updated file, thx for the tip
    if x == y , y == x

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Many Header Files
    By matth in forum C++ Programming
    Replies: 3
    Last Post: 03-08-2005, 02:45 PM
  2. Tutorial review
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 11
    Last Post: 03-22-2004, 09:40 PM
  3. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 10:33 AM
  4. Using c++ standards
    By subdene in forum C++ Programming
    Replies: 4
    Last Post: 06-06-2002, 09:15 AM
  5. Replies: 6
    Last Post: 04-02-2002, 05:46 AM