What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » Good programming language..

Good programming language..
Author: Message:
TheSteve
Full Member
***

Avatar
The Man from Japan

Posts: 179
Reputation: 23
40 / Male / Flag
Joined: Aug 2005
RE: RE: RE: Good programming language..
quote:
Originally posted by Verte
[recently a friend couldn't work out how to convert a string to an integer- turns out you can subtract zero to do this. Just too strange].


That would be subtracting the character '0'. That's possible in C/C++ as well.

For example:
code:
int atoi(const char * pstr) {
    int i;
    int nRet = 0;
    for (i = 0; ; i++) {
        if (pstr[i]==0)
            break;
        if (pstr[i]>='0' && pstr[i]<='9') {
            nRet*=10;
            nRet+=pstr[i]-'0';
        }
        else return 0;
    }
    return nRet;
}
06-27-2007 11:05 AM
Profile PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Good programming language.. - by Jhrono on 06-27-2007 at 12:03 AM
RE: Good programming language.. - by Knucks on 06-27-2007 at 12:11 AM
RE: Good programming language.. - by Jhrono on 06-27-2007 at 12:13 AM
RE: Good programming language.. - by TheSteve on 06-27-2007 at 12:17 AM
RE: Good programming language.. - by Jhrono on 06-27-2007 at 12:19 AM
RE: Good programming language.. - by albert on 06-27-2007 at 01:14 AM
RE: Good programming language.. - by Jhrono on 06-27-2007 at 01:22 AM
RE: Good programming language.. - by albert on 06-27-2007 at 01:34 AM
RE: RE: Good programming language.. - by Verte on 06-27-2007 at 08:59 AM
RE: Good programming language.. - by lopardo on 06-27-2007 at 02:38 AM
RE: Good programming language.. - by NanaFreak on 06-27-2007 at 03:28 AM
RE: Good programming language.. - by foaly on 06-27-2007 at 08:12 AM
RE: Good programming language.. - by ShawnZ on 06-27-2007 at 09:06 AM
RE: RE: Good programming language.. - by Verte on 06-27-2007 at 09:33 AM
RE: Good programming language.. - by ShawnZ on 06-27-2007 at 09:39 AM
RE: RE: Good programming language.. - by Verte on 06-27-2007 at 10:17 AM
RE: Good programming language.. - by Jarrod on 06-27-2007 at 09:41 AM
RE: RE: RE: Good programming language.. - by TheSteve on 06-27-2007 at 11:05 AM
RE: RE: RE: RE: Good programming language.. - by Verte on 06-27-2007 at 12:01 PM
RE: Good programming language.. - by Jhrono on 06-27-2007 at 03:08 PM
RE: Good programming language.. - by markee on 06-28-2007 at 09:59 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On