![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 |
|
Programming Guru
![]() Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5
![]() |
Yeah sorry Jayme, I edited my post, but it's because of the string class operator==.
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for." -- Socrates |
|
|
|
|
|
#12 | |
|
Professional Programmer
|
Gotta love the string class.
__________________
▄▄▄▄ 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! ▄▄▄▄ |
|
|
|
|
|
|
#13 | |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Quote:
__________________
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 |
|
|
|
|
|
|
#14 |
|
Expert Programmer
|
I found it confusing that you named the variable myString rather than myCharArray or such.
|
|
|
|
|
|
#15 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
The term, 'string', predates C++ AND C. So do the words, 'vector', 'reference', etc. Some of us are older than others, even though our memory now sucks.
__________________
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 |
|
|
|
|
|
#16 | |
|
Programming Guru
![]() Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5
![]() |
Quote:
![]() We have another word like that, "beamer", which is also an English word but it's non-existing in the English language, the English word is "(video) projector".
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for." -- Socrates |
|
|
|
|
|
|
#17 | |
|
Programming Guru
![]() Join Date: Jun 2005
Location: Adelaide, South Australia
Posts: 1,223
Rep Power: 5
![]() |
Quote:
The treatment of strings and arrays in C (and hence C++) is a little strange. Novices tend to think of the "Hello" as a string (or if they are pedantic, as a string literal) but, to the compiler, it is an array of 6 (yes, I mean 6) characters. So you can only manipulate it (assign to it if it's variable, compare it with other string literals, etc) using operations that work on arrays. Functions like strcpy() and strcmp() do that (and are normally the things the programmer needs to use), while operators like = or == compare pointers rather than arrays. And, to confuse things further, the C++ standard library includes a string type, which is technically a C++ class that encapsulates an array of characters. |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|