Welcome to Dream.In.Code
Become a C++ Expert!

Join 137,266 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,506 people online right now. Registration is fast and FREE... Join Now!




Letter convert...

 
Reply to this topicStart new topic

Letter convert...

chadly724
11 Dec, 2006 - 09:40 PM
Post #1

New D.I.C Head
*

Joined: 26 Oct, 2006
Posts: 14


My Contributions
i need to take an inputted sentence and whatever is inputted needs to be put into all capital letters... i'm thinking of using the binary values of each letter to tell if it's capital or lower-case. anyone know of an easier way. i'm not looking for code jsut an idea...
User is offlineProfile CardPM
+Quote Post

eXceed69
RE: Letter Convert...
11 Dec, 2006 - 09:53 PM
Post #2

"Super Sentai Knight Of DawN"
Group Icon

Joined: 12 Nov, 2006
Posts: 682



Thanked: 1 times
Dream Kudos: 675
My Contributions
how bout ASCII..rather than binary..that will be long..biggrin.gif
User is offlineProfile CardPM
+Quote Post

chadly724
RE: Letter Convert...
11 Dec, 2006 - 10:14 PM
Post #3

New D.I.C Head
*

Joined: 26 Oct, 2006
Posts: 14


My Contributions
thanks i'll try finding the obvious answers before i post from now on tongue.gif
User is offlineProfile CardPM
+Quote Post

eXceed69
RE: Letter Convert...
11 Dec, 2006 - 10:20 PM
Post #4

"Super Sentai Knight Of DawN"
Group Icon

Joined: 12 Nov, 2006
Posts: 682



Thanked: 1 times
Dream Kudos: 675
My Contributions
your welcome...biggrin.gif

User is offlineProfile CardPM
+Quote Post

Xing
RE: Letter Convert...
11 Dec, 2006 - 10:44 PM
Post #5

D.I.C Addict
Group Icon

Joined: 22 Jul, 2006
Posts: 723



Thanked: 2 times
Dream Kudos: 1575
My Contributions
QUOTE(chadly724 @ 12 Dec, 2006 - 11:10 AM) *

i need to take an inputted sentence and whatever is inputted needs to be put into all capital letters... i'm thinking of using the binary values of each letter to tell if it's capital or lower-case. anyone know of an easier way. i'm not looking for code jsut an idea...


Can't you use toupper ?
User is offlineProfile CardPM
+Quote Post

mattman059
RE: Letter Convert...
12 Dec, 2006 - 07:51 PM
Post #6

D.I.C Regular
Group Icon

Joined: 23 Oct, 2006
Posts: 340


Dream Kudos: 175
My Contributions
just use toupper()...
User is offlineProfile CardPM
+Quote Post

ifoam
RE: Letter Convert...
12 Dec, 2006 - 08:20 PM
Post #7

D.I.C Head
**

Joined: 26 Oct, 2006
Posts: 54



Thanked: 1 times
My Contributions
CODE
#include <cctype>
#include <iostream>

using namespace std;

int main()
{
    char d='a';  
    d=toupper(d);
    cout<<d;
}

User is offlineProfile CardPM
+Quote Post

eXceed69
RE: Letter Convert...
12 Dec, 2006 - 08:28 PM
Post #8

"Super Sentai Knight Of DawN"
Group Icon

Joined: 12 Nov, 2006
Posts: 682



Thanked: 1 times
Dream Kudos: 675
My Contributions
CODE

#include <cctype>
#include <iostream>

using namespace std;

int main()
{
    char input='';
    cout<<"enter a letter"  
    cin>>input;
    input=toupper(input);
    cout<<"your letter is"<<input;
    return 0;
}


here it is ..biggrin.gif
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/4/08 07:29PM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month