Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jun 9th, 2006, 6:02 PM   #11
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Well, you can take blood from the contributor by shooting his ass, as well as with a needle. I wonder why the Red Cross doesn't do it that way...it's easier.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Jun 9th, 2006, 6:13 PM   #12
nnxion
Programming Guru
 
nnxion's Avatar
 
Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5 nnxion is on a distinguished road
Splinter you are missing the point, he clearly said:
Quote:
Originally Posted by aron_h
(i know i took unnecessary lengths to have it output the text. it's not the text that is the intended goal, it's the process)
He just wants to know how the intented process works. Grumpy helped him out with that in post #3.
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for."
-- Socrates
nnxion is offline   Reply With Quote
Old Jun 9th, 2006, 6:14 PM   #13
splinter9x
Hobbyist Programmer
 
splinter9x's Avatar
 
Join Date: Jun 2006
Posts: 137
Rep Power: 0 splinter9x is an unknown quantity at this point
Sorry I was just showing him that there is simpler ways to get what you want in your code...
__________________
Visit my Blog
I support WINDOWS...
splinter9x is offline   Reply With Quote
Old Jun 9th, 2006, 7:19 PM   #14
jayme
Professional Programmer
 
jayme's Avatar
 
Join Date: Nov 2005
Location: Canada
Posts: 495
Rep Power: 0 jayme is an unknown quantity at this point
Send a message via MSN to jayme
You're missing the point. He obviously knows how to output a simple string. He is trying to take small steps into the world of C++, that's why he's using the variables for such simple tasks. What I understand from what you say is that if you were to make an rpg, you would simply guess the character name that the mass amount of players will be using, instead of simply allowing input from the user as to what his players name shall be.

EDIT: You should really try to be more open when dealing with other people's knowledge of C++. People have different ways of doing things. Some like to take the easy road, some like a challenge.
__________________

Quote:
Originally Posted by Mohamed Jihad
Durka durka!
Due to incorrect calculations during the middle ages, our calendar actually begins a few years after Jesus' birth. Thus the real 6/6/6 happened a few years back. The world already ended and you missed it.

Download Code::Blocks now!
jayme is offline   Reply With Quote
Old Jun 9th, 2006, 7:20 PM   #15
splinter9x
Hobbyist Programmer
 
splinter9x's Avatar
 
Join Date: Jun 2006
Posts: 137
Rep Power: 0 splinter9x is an unknown quantity at this point
Ok then...
__________________
Visit my Blog
I support WINDOWS...
splinter9x is offline   Reply With Quote
Old Jun 9th, 2006, 7:25 PM   #16
grumpy
Programming Guru
 
grumpy's Avatar
 
Join Date: Jun 2005
Location: Adelaide, South Australia
Posts: 1,260
Rep Power: 5 grumpy will become famous soon enough
Sigh, splinter.

The actual problem of concern had nothing to do with finding a simple way to print "Mr. John A Smith kicks ass!". We all know how to do that, and don't need to be told how.

Answering questions and helping people rarely means taking their code snippets and boiling then down to a single output statement. More usually, as in this case, it requires interpreting their question and code and explaining the behaviour they are encountering. That was needed here, and you didn't do it, so your response was unhelpful.

The original question could have been written as this ....

Why does the following code snippet print a lower case 'a' rather than an upper case 'A'?
#include <string>
#include <iostream>
int main()
{
    std::string x;
    x = 'A' + ' ';
    std::cout << x << '\n';
}

Why didn't aron_h ask that question? Simple. Because he had a problem that he didn't fully understand, so didn't know that his problem could have been boiled down that way. Few people ask a question when they know the actual answer. Which requires people to interpret the question and work out what the real problem is.

Telling him (as you have effectively done) that he should have done this
#include <iostream>
int main()
{
   std::cout << "A\n";
}
is pointless. It does not address the real problem. Very few people need to be told how to print the letter A, and the OP is clearly not among them.

There is no need to tell people how to suck eggs. If you keep failing to understand that, you will remain unhelpful.
grumpy is offline   Reply With Quote
Old Jun 9th, 2006, 9:13 PM   #17
aron_h
Newbie
 
Join Date: Jun 2006
Location: Canada
Posts: 8
Rep Power: 0 aron_h is on a distinguished road
thanks for the help, i understand what i did wrong now.

as for splinter, i understand where you're coming from, but i don't really care about the message that's being output, i just needed practice with variables and such, which is why i did it that way. i fully understand that i could have just as quickly written cout << "Mr. John A Smith kicks ass";

oh and i'll be sure to remember to use code tags next time.
aron_h is offline   Reply With Quote
Old Jun 9th, 2006, 9:14 PM   #18
aron_h
Newbie
 
Join Date: Jun 2006
Location: Canada
Posts: 8
Rep Power: 0 aron_h is on a distinguished road
testing
aron_h is offline   Reply With Quote
Old Jun 9th, 2006, 9:30 PM   #19
splinter9x
Hobbyist Programmer
 
splinter9x's Avatar
 
Join Date: Jun 2006
Posts: 137
Rep Power: 0 splinter9x is an unknown quantity at this point
Ok sorry for all the trouble I coused or whatever. I just thought you were trying to go about something not knowing that there was an easier way, my bad.
__________________
Visit my Blog
I support WINDOWS...
splinter9x is offline   Reply With Quote
Old Jun 9th, 2006, 9:34 PM   #20
aron_h
Newbie
 
Join Date: Jun 2006
Location: Canada
Posts: 8
Rep Power: 0 aron_h is on a distinguished road
not a problem, it's logical to think that.
aron_h is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 6:15 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC