xboxscene.org forums

Author Topic: Another C++ Question  (Read 124 times)

laxb0y1o

  • Archived User
  • Full Member
  • *
  • Posts: 112
Another C++ Question
« on: December 02, 2005, 03:15:00 PM »

i am trying to create a program that will take a name like GEORGE WALKER BUSH and change it to George Walker Bush. Do u get my drift?
Logged

BILLS

  • Archived User
  • Sr. Member
  • *
  • Posts: 297
Another C++ Question
« Reply #1 on: December 02, 2005, 03:47:00 PM »

not sure if the function is in C++, but in other languages their is a Ucase function that could help you with that.
Logged

laxb0y1o

  • Archived User
  • Full Member
  • *
  • Posts: 112
Another C++ Question
« Reply #2 on: December 04, 2005, 06:02:00 PM »

nope
Logged

anon123

  • Archived User
  • Newbie
  • *
  • Posts: 45
Another C++ Question
« Reply #3 on: December 04, 2005, 08:37:00 PM »

isnt the ascii value of any character that is uppercase just 32 below any character that is lowercase?  So what you should do is first check the second character of each word, looping through each letter until you hit a space (the end of that word).  then you check the ascii range of each character (see if it is from 65 to 90 by typecasting it to an int first), and if it is, you add 32 to it and typecast it back to a char (making that uppercase character a lowercase one).

This post has been edited by anon123: Dec 5 2005, 04:38 AM
Logged

laxb0y1o

  • Archived User
  • Full Member
  • *
  • Posts: 112
Another C++ Question
« Reply #4 on: December 06, 2005, 11:53:00 AM »

yea...thats how i eventually got it. Thanks for you help guys! If you want to see the completed project let me know!
Logged