Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Re: Unsigned types are DANGEROUS??

Reply
Thread Tools

Re: Unsigned types are DANGEROUS??

 
 
Paul
Guest
Posts: n/a
 
      03-16-2011

"SG" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On 16 Mrz., 05:30, Paul wrote:
>> SG wrote:
>> > On 15 Mrz., 19:35, "Paul" wrote:

>>
>> >> I don't see what your confusion is. If the standard states:
>> >> "A name is a use of an identifier (2.10) that denotes an entity"
>> >> then with:

>>
>> >> type* p_name = new type[16];

>>
>> >> p_name is the name of the entity, that is the array.
>> >> The above expression creates an array, you seem confused about
>> >> this, similarly to Leigh and Noah.
>> >> Do you think this is not array?

>>
>> > What exacly? p_name? p_name denotes a pointer variable. You
>> > initialized this pointer to store the address of the first element of
>> > a dynamically allocated array.

>>
>> >> The fact that the identifier is a pointer goes without saying,

>>
>> > Does it? I honestly can't tell what things go without saying and what
>> > not when it comes to "discussing" something with you. btw: To be very
>> > precise: The identifier *denotes* a pointer variable. An identifier is
>> > a sequence of characters in your source code file.

>>
>> >> as does the
>> >> fact that its name is p_name. The entity is an array structure,

>>
>> > The entity whose name is p_name is a pointer variable. Period.

>>
>> No Period.
>> If I use the name in an expression like so:
>> p_name[AnIndex];

>
> That does not prove anything.
>
>> p_name is the name of an array entity.

>
> It's not -- using any reasonable interpretation of the C++ ISO
> standard.


Yes it is, and I don't care what the standards redefines name/identifier to
mean. It means exactly what It means as defined in the english dictionary.


>
>> >> [...] why I don't understand.

>>
>> > Might I ask what book(s) you used to learn C and/or C++?

>>
>> Turbo C++ version 3.0 or something. It came in a big brown box with 2 big
>> manuals and ran on win95.
>> [...]
>> What books did you learn C++ from?

>
> The good kind.
>
> "The C++ Programming Language" (Special Edition) by Bjarne Stroustrup
> "Effective C++" (3rd edition) by Scott Meyers
> "C++ Templates: The Complete Guide" by Vandevoorde and Josuttis
> "The Design and Evolution of C++" by Bjarne Stroustrup
>
> and the occasional look into the standard drafts that are publicly
> available for free, starting with a very early C++0x draft n1804.pdf
> which contains almost no C++0x feature (except long long, for
> example).
>
> I have other C++ related books in my shelf. But I wouldn't say that I
> learned much C++ from them.
>

Seems like you have a very confused learning curve, perhaps this is why you
are still confused now.

GL

 
Reply With Quote
 
 
 
 
SG
Guest
Posts: n/a
 
      03-16-2011
Paul wrote:
> [...]
> I don't care what the standards redefines name/identifier to mean.
> [...]
> Seems like you have a very confused learning curve,
> perhaps this is why you are still confused now.


If you cared, you wouldn't think that everybody but you is "confused".
Also, I wouldn't use the word "redefine" here. "disambiguate" would be
a more fitting word, IMHO. To talk about abstract things one has to
agree on rather precise definitions.

SG
 
Reply With Quote
 
 
 
 
Paul
Guest
Posts: n/a
 
      03-16-2011

"SG" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Paul wrote:
>> [...]
>> I don't care what the standards redefines name/identifier to mean.
>> [...]
>> Seems like you have a very confused learning curve,
>> perhaps this is why you are still confused now.

>
> If you cared, you wouldn't think that everybody but you is "confused".
> Also, I wouldn't use the word "redefine" here. "disambiguate" would be
> a more fitting word, IMHO. To talk about abstract things one has to
> agree on rather precise definitions.
>

Thats just the problem you can't agree that a dynamic array exists.

int* arr = new int[16];
arr[0] = 5;

It's an an array. It's not *just* a pointer.

I have nothing more to say on this subject unless you can accept this fact.

 
Reply With Quote
 
SG
Guest
Posts: n/a
 
      03-16-2011
On 16 Mrz., 17:42, Paul wrote:
> SG wrote:
> >> [...]
> >> I don't care what the standards redefines name/identifier to mean.
> >> [...]
> >> Seems like you have a very confused learning curve,
> >> perhaps this is why you are still confused now.

>
> > If you cared, you wouldn't think that everybody but you is "confused".
> > Also, I wouldn't use the word "redefine" here. "disambiguate" would be
> > a more fitting word, IMHO. To talk about abstract things one has to
> > agree on rather precise definitions.

>
> Thats just the problem you can't agree that a dynamic array exists.


I did not say that it does not exist. I said that it does not have a
name.

> int* arr = new int[16];
> arr[0] = 5;
>
> It's an an array. It's not *just* a pointer.


arr is not an array. arr is a pointer. Being a pointer and being an
array are mutually exclusive. If you intent to use C++ prefessionally
(I'd hazard the guess that this is currently not the case) you better
"unlearn your C++" and get hold of a decent C++ book. You are
currently unfit to communicate about C++ related matters. Don't take
this personally. You're welcome.

SG
 
Reply With Quote
 
Paul
Guest
Posts: n/a
 
      03-17-2011

"SG" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On 16 Mrz., 17:42, Paul wrote:
>> SG wrote:
>> >> [...]
>> >> I don't care what the standards redefines name/identifier to mean.
>> >> [...]
>> >> Seems like you have a very confused learning curve,
>> >> perhaps this is why you are still confused now.

>>
>> > If you cared, you wouldn't think that everybody but you is "confused".
>> > Also, I wouldn't use the word "redefine" here. "disambiguate" would be
>> > a more fitting word, IMHO. To talk about abstract things one has to
>> > agree on rather precise definitions.

>>
>> Thats just the problem you can't agree that a dynamic array exists.

>
> I did not say that it does not exist. I said that it does not have a
> name.
>
>> int* arr = new int[16];
>> arr[0] = 5;
>>
>> It's an an array. It's not *just* a pointer.

>
> arr is not an array. arr is a pointer. Being a pointer and being an
> array are mutually exclusive. If you intent to use C++ prefessionally
> (I'd hazard the guess that this is currently not the case) you better
> "unlearn your C++" and get hold of a decent C++ book. You are
> currently unfit to communicate about C++ related matters. Don't take
> this personally. You're welcome.
>

And you're just a dumb ass idiot who doesn't understand the language , don't
take it personally

 
Reply With Quote
 
SG
Guest
Posts: n/a
 
      03-17-2011
Paul, I'm sure that many others think of you as an idiot as well. But
expressing these kinds of opinions is not going to have any positive
effects whatsoever. It's quite the opposite. So, you might as well
just save your time.

Anyhow, let me point one issue:

On 17 Mrz., 15:10, Paul wrote:
> >> int* E1 = new int[16];
> >> ++E1;
> >> E1[-1] = 6;

> [...]
> I am not even reading your long winded explnation of what E1 is
> above. I'm simply "telling" you it's an array, I don't care what
> you think I'm telling you wehat it simply is.
> [...]
> I don't care what the standards redefines name/identifier to mean.
> [...]
> You are obvioulsy an extremely thick person,
> just like the other idiots who think this idiotic way.
> I don't mean to be rude or nasty but that is simply how it is,
> I find you to be a dumb idiot.
> GL with C++, you're going to need it.
> [...]
> THe only misinformed opinion around here is the IDIOTS that think an
> array is not an array because its a pointer.


Nobody thinks that. You misunderstood and misrepresented that.

> I don't mean to be rude or nasty but I'm sorry I have no other opinion
> on these people, they are just dumb ass idiots and nothing more.
> [...]
> And you're just a dumb ass idiot who doesn't understand the language,
> [...]


SG
 
Reply With Quote
 
Paul
Guest
Posts: n/a
 
      03-17-2011

"SG" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Paul, I'm sure that many others think of you as an idiot as well. But
> expressing these kinds of opinions is not going to have any positive
> effects whatsoever. It's quite the opposite. So, you might as well
> just save your time.
>
> Anyhow, let me point one issue:
>
> On 17 Mrz., 15:10, Paul wrote:
>> >> int* E1 = new int[16];
>> >> ++E1;
>> >> E1[-1] = 6;

>> [...]
>> I am not even reading your long winded explnation of what E1 is
>> above. I'm simply "telling" you it's an array, I don't care what
>> you think I'm telling you wehat it simply is.
>> [...]
>> I don't care what the standards redefines name/identifier to mean.
>> [...]
>> You are obvioulsy an extremely thick person,
>> just like the other idiots who think this idiotic way.
>> I don't mean to be rude or nasty but that is simply how it is,
>> I find you to be a dumb idiot.
>> GL with C++, you're going to need it.
>> [...]
>> THe only misinformed opinion around here is the IDIOTS that think an
>> array is not an array because its a pointer.

>
> Nobody thinks that. You misunderstood and misrepresented that.
>

Thats exactly what you've been saying.

 
Reply With Quote
 
Paul
Guest
Posts: n/a
 
      03-17-2011

"SG" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Paul, I'm sure that many others think of you as an idiot as well. But
> expressing these kinds of opinions is not going to have any positive
> effects whatsoever. It's quite the opposite. So, you might as well
> just save your time.
>
> Anyhow, let me point one issue:
>
> On 17 Mrz., 15:10, Paul wrote:
>> >> int* E1 = new int[16];
>> >> ++E1;
>> >> E1[-1] = 6;

>> [...]
>> I am not even reading your long winded explnation of what E1 is
>> above. I'm simply "telling" you it's an array, I don't care what
>> you think I'm telling you wehat it simply is.
>> [...]
>> I don't care what the standards redefines name/identifier to mean.
>> [...]
>> You are obvioulsy an extremely thick person,
>> just like the other idiots who think this idiotic way.
>> I don't mean to be rude or nasty but that is simply how it is,
>> I find you to be a dumb idiot.
>> GL with C++, you're going to need it.
>> [...]
>> THe only misinformed opinion around here is the IDIOTS that think an
>> array is not an array because its a pointer.

>
> Nobody thinks that. You misunderstood and misrepresented that.
>

That's exactly what you(lot) think. I have misunderstood nothing, nor have I
misrepresented anything.
You don't have the intelligence to understand that E1 represents an array.
It's very basic stuff and if you can't even understand the basics perhaps
you should go back to your books and relearn C++.

Start by trying to understand that a dynamic array is in fact an array. You
obviously think that because the identifier is a pointer-type it's not an
array, which is of course completely incorrect.





 
Reply With Quote
 
Noah Roberts
Guest
Posts: n/a
 
      03-17-2011
On 3/17/2011 11:30 AM, Leigh Johnston wrote:
> On 17/03/2011 18:28, Paul wrote:


>> Start by trying to understand that a dynamic array is in fact an array.
>> You obviously think that because the identifier is a pointer-type it's
>> not an array, which is of course completely incorrect.
>>

>
> An array is not a pointer and a pointer is not an array; pretty simple
> to grasp IMO; I wonder why you are having difficulties?


Guys...

"I am an amateur programmer who hasnt even looked at any programming for
over 5 years."
"This enforces my choice to stop learning any further C++ *shrug*" -
2/19/11 4:23

"I just batter the keypad and deny anything you say now because I
dislike you sso much." - 3/16/11 7:16

This Paul guy neither knows C++, nor cares to know C++, nor cares what
he is saying. This by his very own words. His participation here is
obviously for no other purpose than to see his own name and to garner as
many replies as possible. Attempting to argue with someone that is
fully aware of not knowing what they're talking about, doesn't care, and
is arguing for its own sake is never going to get you anywhere.

The fact that this poster (apparently) regularly argues completely
ass-backward points should not be surprising to anyone. It has nothing
to do with C++ and everything to do with Paul. I'm sure he'd argue that
up is down if given half the opportunity and attention.

--
http://crazycpp.wordpress.com
 
Reply With Quote
 
Paul
Guest
Posts: n/a
 
      03-17-2011

"Leigh Johnston" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ...
> On 17/03/2011 18:28, Paul wrote:
>>
>> "SG" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> Paul, I'm sure that many others think of you as an idiot as well. But
>>> expressing these kinds of opinions is not going to have any positive
>>> effects whatsoever. It's quite the opposite. So, you might as well
>>> just save your time.
>>>
>>> Anyhow, let me point one issue:
>>>
>>> On 17 Mrz., 15:10, Paul wrote:
>>>> >> int* E1 = new int[16];
>>>> >> ++E1;
>>>> >> E1[-1] = 6;
>>>> [...]
>>>> I am not even reading your long winded explnation of what E1 is
>>>> above. I'm simply "telling" you it's an array, I don't care what
>>>> you think I'm telling you wehat it simply is.
>>>> [...]
>>>> I don't care what the standards redefines name/identifier to mean.
>>>> [...]
>>>> You are obvioulsy an extremely thick person,
>>>> just like the other idiots who think this idiotic way.
>>>> I don't mean to be rude or nasty but that is simply how it is,
>>>> I find you to be a dumb idiot.
>>>> GL with C++, you're going to need it.
>>>> [...]
>>>> THe only misinformed opinion around here is the IDIOTS that think an
>>>> array is not an array because its a pointer.
>>>
>>> Nobody thinks that. You misunderstood and misrepresented that.
>>>

>> That's exactly what you(lot) think. I have misunderstood nothing, nor
>> have I misrepresented anything.
>> You don't have the intelligence to understand that E1 represents an
>> array. It's very basic stuff and if you can't even understand the basics
>> perhaps you should go back to your books and relearn C++.
>>
>> Start by trying to understand that a dynamic array is in fact an array.
>> You obviously think that because the identifier is a pointer-type it's
>> not an array, which is of course completely incorrect.
>>

>
> An array is not a pointer and a pointer is not an array; pretty simple to
> grasp IMO; I wonder why you are having difficulties?
>

That is the view of a very narrow minded simpleton. He obviously doesn't
have a very good understanding of the language.
The C++ standards clearly state:
"the subscript operator [] is interpreted in such a way
that E1[E2] is identical to *((E1)+(E2))."

If he had any understanding of the language he would understand that all
arrays are converted to pointers. The only difference with dynamic arrays is
that no implict conversion is required because the arrays identifier is
already a pointer.


 
Reply With Quote
 
 
 
Reply

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
(int) -> (unsigned) -> (int) or (unsigned) -> (int) -> (unsigned):I'll loose something? pozz C Programming 12 03-20-2011 11:32 PM
unsigned long to unsigned char ashtonn@gmail.com Python 1 06-01-2005 07:00 PM
comparing unsigned long and unsigned int sridhar C Programming 6 11-03-2004 03:52 AM
unsigned int const does not match const unsigned int Timo Freiberger C++ 3 10-30-2004 07:02 PM
Assigning unsigned long to unsigned long long George Marsaglia C Programming 1 07-08-2003 05:16 PM



Advertisments