|
-
Nov 14th, 2001, 06:33 PM
#1
Works for me
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Nov 14th, 2001, 06:37 PM
#2
Member
1. First tell us the error 
2. Try including <ctype.h>
-
Nov 14th, 2001, 07:28 PM
#3
Fanatic Member
Tolower
I want to transform I into lowercase
as if I is an CIN from the user.
Please give advice

prog_tom
JOIN THE REVOLUTION!!!! Dual T3 backedup science community.
http://physics.sviesoft.com/forum
-
Nov 14th, 2001, 07:31 PM
#4
Re: Tolower
Originally posted by prog_tom
I want to transform I into lowercase
as if I is an CIN from the user.
Please give advice
I'm not really following. You cin a char into I, say 'V', and tolower() makes it lower case. It works for me.
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Nov 14th, 2001, 07:32 PM
#5
Fanatic Member
Code
Can you post the code of getting lowercase of a CIN? Thanks

prog_tom
JOIN THE REVOLUTION!!!! Dual T3 backedup science community.
http://physics.sviesoft.com/forum
-
Nov 14th, 2001, 07:35 PM
#6
Code:
#include <iostream>
#include <time.h>
#include <math.h>
using namespace std;
char I;
void main()
{
system("cls");
cin >> I;
I = tolower(I);
cout << "\n\tWelcome to this hot stuff! " << I << endl;
system("pause");
exit(0);
}
your code works for me.
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Nov 14th, 2001, 07:49 PM
#7
Fanatic Member

prog_tom
JOIN THE REVOLUTION!!!! Dual T3 backedup science community.
http://physics.sviesoft.com/forum
-
Nov 14th, 2001, 07:49 PM
#8
Fanatic Member
I want
I want it to do it for up to 256 chars

prog_tom
JOIN THE REVOLUTION!!!! Dual T3 backedup science community.
http://physics.sviesoft.com/forum
-
Nov 14th, 2001, 07:56 PM
#9
PowerPoster
Re: I want
Originally posted by prog_tom
I want it to do it for up to 256 chars
It will work for all the upper case letters. I think, I is confusing you. Use this code:
VB Code:
#include <iostream>
#include <time.h>
#include <math.h>
using namespace std;
char word;
void main()
{
system("cls");
cin >> word;
word = tolower(word);
cout << "\n\tWelcome to this hot stuff! " << word << endl;
system("pause");
exit(0);
}
Now, if you type "A", it`s gonna print ``a``. Samething for all the other letters.
-
Nov 14th, 2001, 08:00 PM
#10
transcendental analytic
If you want to uppercase a whole C style string you can iterate trough the array and lowercase each letter
char I[256],*i;
cin >> I;
for(i=I;*i;*i++=tolower(*i));
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Nov 17th, 2001, 07:36 AM
#11
Addicted Member
that's pretty it the easiest solution..........just use the for loop or any other iteration command
-
Nov 17th, 2001, 02:57 PM
#12
keda, this is the most confusing code I've EVER EVER seen! Such things easily fall to the postfix/prefix trap! I don't fear that you'll ever fall into it, but it can easily hit others in snippets like this...
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Nov 18th, 2001, 03:11 PM
#13
transcendental analytic
I know the operator presedence pretty well
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|