Click here to Skip to main content
6,822,613 members and growing! (16,575 online)
Email Password   helpLost your password?

C / C++ / MFC



You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page  Date Filter 
 Msgs 41,098 to 41,122 of 412,955 (Total in Forum: 412,955) (Refresh)FirstPrevNext
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

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    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

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


Last Updated 10 Aug 2007
Web21 | 2.2.0230 (18:30 2 Apr '10 ) | Advertise | Privacy
Copyright © CodeProject, 1999-2010
All Rights Reserved. Terms of Use