473,396 Members | 1,767 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

array

why array can't be assigned, like structs?

Mar 8 '07
57 3182
Richard Heathfield wrote:
Default User said:
Richard Heathfield wrote:
Default User said:
Richard Heathfield wrote:
Default User said:
<http://groups.google.com/support/bin/topic.py?topic=9246>

What would Google know about newsgroups?

He's a Google user, he ought to be at least familiar with their
help section.

Yeah. What he might not realise from reading Google's help pages is
that newsgroups are not a Google product, but a well-established
on-line society to which Google has attached itself like a remora.
Did you actually READ the link I provided?

Yes, actually. Hence "might not" rather than "will not".

There is no document that can't be misinterpreted by a sufficiently
stupid reader. The one I pointed to was clear enough in my mind for the
designated purpose.


Brian
Mar 10 '07 #51
Mark McIntyre <ma**********@spamcop.netwrites:
On 10 Mar 2007 08:10:53 -0800, in comp.lang.c , "Harald van D?k"
<tr*****@gmail.comwrote:
>>You snipped too much. You claimed that an array isn't a type, and that
that is the reason it has to be different.

You apparently mentally snipped too much, for the distinction I was
drawing was between a simple and derived type.
That distinction is irrelevant in this case.

You claimed that array types are not types. You were wrong.
>>And I showed that you /can/ assign to a struct using that same method.

So what? As I've said ad nauseam, you can't prove it by example, only
disprove by counterexample.
Fine, forget about examples and counterexamples.

int is a non-derived type. The language supports assignment for type int.

void is a non-derived type. The language does not support assignment
for type void.

A structure type is a derived type. The language supports assignment
for structure types.

An array type is a derived type. The language does not support
assignment for array types.

Conclusion: The fact that assignment is not supported for array types
has nothing to do with the fact that array types are derived types.
You claimed that there was a relationship. You were incorrect.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Mar 10 '07 #52
Mark McIntyre <ma**********@spamcop.netwrites:
On Fri, 09 Mar 2007 17:04:54 -0800, in comp.lang.c , Keith Thompson
<ks***@mib.orgwrote:
>>Mark, you could save us all a great deal of time and trouble if, every
now and then, you'd just admit when you've made a mistake.

I would, if I thought I had. I don't think I have.
Is an array type a type? You said upthread that it isn't.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Mar 10 '07 #53
Mark McIntyre <ma**********@spamcop.netwrites:
On Fri, 09 Mar 2007 17:05:49 -0800, in comp.lang.c , Keith Thompson
<ks***@mib.orgwrote:
>>Mark McIntyre <ma**********@spamcop.netwrites:
>>On Thu, 08 Mar 2007 17:31:40 -0800, in comp.lang.c , Keith Thompson
<ks***@mib.orgwrote:
Yes, it would have been clearer. It would also have been correct,
which your original statement quite simply was not.

My original statement was absolutely correct, An array is a derived
type.
One of your original statements was that an array is a derived type.
That's absolutely correct, and nobody has claimed otherwise.

Another of your original statements was that an array is not a type.
That's wrong; an array is a type.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Mar 10 '07 #54
Mark McIntyre wrote:
On 10 Mar 2007 08:10:53 -0800, in comp.lang.c , "Harald van D?k"
<tr*****@gmail.comwrote:
You snipped too much. You claimed that an array isn't a type, and that
that is the reason it has to be different.

You apparently mentally snipped too much, for the distinction I was
drawing was between a simple and derived type.
You're probably confusing me with some others in this thread. I
treated "isn't a type" as "isn't a simple type" in my replies. Please
re-read my message.
And I showed that you /can/ assign to a struct using that same method.

So what? As I've said ad nauseam, you can't prove it by example, only
disprove by counterexample.
It disproved your claim that you cannot assign to a struct using that
same method.

What you probably meant, is that I cannot prove that it applies to /
all/ structure types using just an example. If that's not what you
meant, you're wrong.

Mar 10 '07 #55
Default User said:

<snip>
There is no document that can't be misinterpreted by a sufficiently
stupid reader. The one I pointed to was clear enough in my mind for
the designated purpose.
Ah, but then you are not a sufficiently stupid reader!

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Mar 10 '07 #56
Ben Pfaff wrote:
>
.... snip ...
--
"...Almost makes you wonder why Heisenberg didn't include postinc/dec
operators in the uncertainty principle. Which of course makes the
above equivalent to Schrodinger's pointer..."
--Anthony McDonald
Didn't Schroedinger kept a sealpoint cat, rather than a dog. :-)

--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
<http://www.securityfocus.com/columnists/423>

"A man who is right every time is not likely to do very much."
-- Francis Crick, co-discover of DNA
"There is nothing more amazing than stupidity in action."
-- Thomas Matthews

--
Posted via a free Usenet account from http://www.teranews.com

Mar 11 '07 #57
Richard Heathfield wrote:
Default User said:

<snip>
There is no document that can't be misinterpreted by a sufficiently
stupid reader. The one I pointed to was clear enough in my mind for
the designated purpose.

Ah, but then you are not a sufficiently stupid reader!
The point was that the information I provided, even though it came from
Google, was pretty decent for a brief overview.


Brian
Mar 11 '07 #58

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Brian | last post by:
I'm diddlying with a script, and found some behavior I don't understand. Take this snippet: for ($i = 0; $i <= count($m); $i++) { array_shift($m); reset($m); }
2
by: Stormkid | last post by:
Hi Group I'm trying to figure out a way that I can take two (two dimensional) arrays and avShed and shed, and subtract the matching elements in shed from avShed I've pasted the arrays blow from a...
15
by: lawrence | last post by:
I wanted to test xml_parse_into_struct() so I took the example off of www.php.net and put this code up on a site: <?php $simple = <<<END <item>
8
by: vcardillo | last post by:
Hello all, Okay, I am having some troubles. What I am doing here is dealing with an employee hierarchy that is stored in an array. It looks like this: $employees = array( "user_id" => array(...
12
by: Sam Collett | last post by:
How do I remove an item with a specified value from an array? i.e. array values 1,2,2,5,7,12,15,21 remove 2 from array would return 1,5,7,12,15,21 (12 and 21 are NOT removed, duplicates are...
8
by: Mike S. Nowostawsky | last post by:
I tried using the "toUpperCase()" property to change the value of an array entity to uppercase BUT it tells me that the property is invalid. It seems that an array is not considered an object when...
58
by: jr | last post by:
Sorry for this very dumb question, but I've clearly got a long way to go! Can someone please help me pass an array into a function. Here's a starting point. void TheMainFunc() { // Body of...
104
by: Leszek | last post by:
Hi. Is it possible in javascript to operate on an array without knowing how mamy elements it has? What i want to do is sending an array to a script, and this script should add all values from...
7
by: Jim Carlock | last post by:
Looking for suggestions on how to handle bad words that might get passed in through $_GET variables. My first thoughts included using str_replace() to strip out such content, but then one ends...
17
by: =?Utf-8?B?U2hhcm9u?= | last post by:
Hi Gurus, I need to transfer a jagged array of byte by reference to unmanaged function, The unmanaged code should changed the values of the array, and when the unmanaged function returns I need...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.