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: 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  
AnswerRe: covert to upper PinmemberStuart Dootson22:05 2 Dec '08  
AnswerRe: covert to upper PinmvpDavidCrow6:01 3 Dec '08  
jonig19 wrote:
Why when entered, will it take John_Doe, and convert it to JOHN?DOE

 
Because that's what you've instructed it to do. Do the math. If the underscore's ASCII value is 95, then:
 
95 + (65 - 97) = 95 + (-32) = 63, which is the ASCII value of the question mark.
 
Perhaps you meant to do something like this which only affects lowercase letters:
 
while (name[i] != '\0')
{
    // all of this can be replaced with a call to toupper()
    if ((name[i] >= 'a') && (name[i] <= 'z'))
        name[i] = name[i] - ('a' - 'A');
 
    i++;
}

 

"Love people and use things, not love things and use people." - Unknown

"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch


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  
GeneralRe: Difference between MFC and windows form application Pinmemberfrankis7811:28 2 Dec '08  
GeneralRe: Difference between MFC and windows form application PinmvpRajesh R Subramanian21:33 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
Web02 | 2.5.120210.1 | Last Updated 12 Feb 2012
Copyright © CodeProject, 1999-2012
All Rights Reserved. Terms of Use
Layout: fixed | fluid