Click here to Skip to main content

C / C++ / MFC

    RSS: RSS Feed

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page  Show 
  Refresh
AnswerRe: multi midea timers with windows timer PinmemberStuart Dootson22:11 2 Dec '08  
Questioncovert to upper Pinmemberjonig1917:15 2 Dec '08  
AnswerRe: covert to upper PinmemberMaximilien17:29 2 Dec '08  
AnswerRe: covert to upper PinmemberManish K. Agarwal19:01 2 Dec '08  
GeneralRe: covert to upper Pinmemberjonig1920:20 2 Dec '08  
GeneralRe: covert to upper Pinmemberenhzflep20:38 2 Dec '08  
GeneralRe: covert to upper PinmemberJijo raj8:12 3 Dec '08  
I hope you are doing some C/C++ string exercises. Smile | :) Well, I've modified the program for you. It converts small to caps, ignore capital and numbers and converts all symbols to space. Please have a look at it.
 
void ConvertToUpper ( char name[] )
{
    cin >> name ;
    int i = 0;
 
    // Iterate upto end of string.
    while(name[i] != '\0')
    {
        // Check whether its small letter.
        if( name[i] >= 'a' && 
            name[i] <= 'z' )
        {
            // Convert it to capital.
            name[i] -= 32;
        }
 
        // Check for symbols. if found, convert as space.
        // Check whether its not alphabet
        else if (( name[i] < 'A' || 
                   name[i] > 'Z'))
        {
            // And ensure its not number.
            if( name[i] < '0' || 
                name[i] > '9' )
            {
                // Then its a symbol. So assign it as space.
                name[i] = ' ';
            }
        }
 
        i++;
    }
}
 
I just thought about my old C/C++ string lessons. Big Grin | :-D
 
Regards,
Jijo.
 
_____________________________________________________
 
http://weseetips.com[^] Visual C++ tips and tricks. Updated daily.

AnswerRe: covert to upper PinmemberStuart Dootson22:05 2 Dec '08  
AnswerRe: covert to upper PinmvpDavidCrow6:01 3 Dec '08  
Questionsystem in windows ce Pinmemberarifliminto8616:58 2 Dec '08  
QuestionHow does this translate to c++ Pinmembermonsieur_jj16:40 2 Dec '08  
AnswerRe: How does this translate to c++ PinmemberStuart Dootson22:01 2 Dec '08  
QuestionWhich is the best C++ ERP development toolkit ? Pinmembersumeet12310:02 2 Dec '08  
AnswerRe: Which is the best C++ ERP development toolkit ? Pinmvptoxcct10:11 2 Dec '08  
JokeRe: Which is the best C++ ERP development toolkit PinmvpCPallini10:17 2 Dec '08  
AnswerRe: Which is the best C++ ERP development toolkit ? PinmvpCedric Moonen21:08 2 Dec '08  
AnswerRe: Which is the best C++ ERP development toolkit ? PinmemberStuart Dootson21:56 2 Dec '08  
GeneralRe: Which is the best C++ ERP development toolkit ? Pinmvptoxcct22:17 2 Dec '08  
GeneralRe: Which is the best C++ ERP development toolkit ? PinmemberStuart Dootson22:59 2 Dec '08  
GeneralRe: Which is the best C++ ERP development toolkit ? Pinmvptoxcct23:07 2 Dec '08  
GeneralRe: Which is the best C++ ERP development toolkit ? PinmemberStuart Dootson23:36 2 Dec '08  
GeneralRe: Which is the best C++ ERP development toolkit ? Pinmvptoxcct23:37 2 Dec '08  
AnswerRe: Which is the best C++ ERP development toolkit ? Pinmembersumeet1232:27 3 Nov '09  
QuestionDifference between MFC and windows form application Pinmemberfrankis789:10 2 Dec '08  
AnswerRe: Difference between MFC and windows form application Pinmvptoxcct9:29 2 Dec '08  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web01 | 2.5.120209.1 | Last Updated 10 Feb 2012
Copyright © CodeProject, 1999-2012
All Rights Reserved. Terms of Use
Layout: fixed | fluid