![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
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 |
|
|
|
|
|
#12 | |
|
Programming Guru
![]() Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5
![]() |
Splinter you are missing the point, he clearly said:
Quote:
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for." -- Socrates |
|
|
|
|
|
|
#13 |
|
Hobbyist Programmer
Join Date: Jun 2006
Posts: 137
Rep Power: 0
![]() |
Sorry I was just showing him that there is simpler ways to get what you want in your code...
|
|
|
|
|
|
#14 | |
|
Professional Programmer
|
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:
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! ▄▄▄▄ |
|
|
|
|
|
|
#15 |
|
Hobbyist Programmer
Join Date: Jun 2006
Posts: 137
Rep Power: 0
![]() |
Ok then...
|
|
|
|
|
|
#16 |
|
Programming Guru
![]() Join Date: Jun 2005
Location: Adelaide, South Australia
Posts: 1,260
Rep Power: 5
![]() |
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";
}There is no need to tell people how to suck eggs. If you keep failing to understand that, you will remain unhelpful. |
|
|
|
|
|
#17 |
|
Newbie
Join Date: Jun 2006
Location: Canada
Posts: 8
Rep Power: 0
![]() |
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. |
|
|
|
|
|
#18 |
|
Newbie
Join Date: Jun 2006
Location: Canada
Posts: 8
Rep Power: 0
![]() |
testing |
|
|
|
|
|
#19 |
|
Hobbyist Programmer
Join Date: Jun 2006
Posts: 137
Rep Power: 0
![]() |
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.
|
|
|
|
|
|
#20 |
|
Newbie
Join Date: Jun 2006
Location: Canada
Posts: 8
Rep Power: 0
![]() |
not a problem, it's logical to think that.
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|