Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Make it idiot-proof, and someone will breed a better idiot. -- Oliver Elphick


devel / comp.lang.c / Re: size and length

SubjectAuthor
* size and lengthfir
`* Re: size and lengthMalcolm McLean
 +* Re: size and lengtholcott
 |`- Re: size and lengthfir
 `- Re: size and lengthfir

1
size and length

<b3771529-f6ff-46b1-986b-616393240c34n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21713&group=comp.lang.c#21713

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:6214:1d07:b0:461:e79d:4cd9 with SMTP id e7-20020a0562141d0700b00461e79d4cd9mr10899531qvd.87.1653133163288;
Sat, 21 May 2022 04:39:23 -0700 (PDT)
X-Received: by 2002:a37:c58:0:b0:6a3:2a71:9904 with SMTP id
85-20020a370c58000000b006a32a719904mr9106097qkm.33.1653133163089; Sat, 21 May
2022 04:39:23 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Sat, 21 May 2022 04:39:22 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.151; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.151
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b3771529-f6ff-46b1-986b-616393240c34n@googlegroups.com>
Subject: size and length
From: profesor...@gmail.com (fir)
Injection-Date: Sat, 21 May 2022 11:39:23 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1479
 by: fir - Sat, 21 May 2022 11:39 UTC

writing dynamic arys i noticed one thing (not even noticed but like
bumped my head on it):

imo the size is probably appriopriate name for axemple on this
what realloc takes this is teh size of ram allocked (for example 1 MB)
-when to know length of such array you need to know the size of
its basic element, for example if this is array of ints the length would
be 256*1024

im not sure if this division of those two separate meanings is official
in computer science, doeas maybe some knows something on it?

Re: size and length

<14155a82-32cf-44c5-998b-d663138e9407n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21721&group=comp.lang.c#21721

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:620a:44d4:b0:6a0:2342:c7c6 with SMTP id y20-20020a05620a44d400b006a02342c7c6mr12647917qkp.14.1653265039171;
Sun, 22 May 2022 17:17:19 -0700 (PDT)
X-Received: by 2002:ac8:7d91:0:b0:2f3:b85b:326d with SMTP id
c17-20020ac87d91000000b002f3b85b326dmr14845763qtd.194.1653265038973; Sun, 22
May 2022 17:17:18 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Sun, 22 May 2022 17:17:18 -0700 (PDT)
In-Reply-To: <b3771529-f6ff-46b1-986b-616393240c34n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2a00:23a8:400a:5601:f59d:f45e:849f:1f02;
posting-account=Dz2zqgkAAADlK5MFu78bw3ab-BRFV4Qn
NNTP-Posting-Host: 2a00:23a8:400a:5601:f59d:f45e:849f:1f02
References: <b3771529-f6ff-46b1-986b-616393240c34n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <14155a82-32cf-44c5-998b-d663138e9407n@googlegroups.com>
Subject: Re: size and length
From: malcolm....@gmail.com (Malcolm McLean)
Injection-Date: Mon, 23 May 2022 00:17:19 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2113
 by: Malcolm McLean - Mon, 23 May 2022 00:17 UTC

On Saturday, 21 May 2022 at 12:39:30 UTC+1, fir wrote:
> writing dynamic arys i noticed one thing (not even noticed but like
> bumped my head on it):
>
> imo the size is probably appriopriate name for axemple on this
> what realloc takes this is teh size of ram allocked (for example 1 MB)
> -when to know length of such array you need to know the size of
> its basic element, for example if this is array of ints the length would
> be 256*1024
>
> im not sure if this division of those two separate meanings is official
> in computer science, doeas maybe some knows something on it?
>
A lot of languages don't make it easy to determine the number of bytes
used by an array. So there's no convention that "size" represents a
number of bytes whilst "length" represents a number of elements.

If would make sense for C, but the C++ standard template library uses
"szie" for a count, so that ship has sailed.

Re: size and length

<c7WdnV6VZO8eORb_nZ2dnUU7_81g4p2d@giganews.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21722&group=comp.lang.c#21722

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!buffer1.nntp.dca1.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Mon, 23 May 2022 10:13:07 -0500
Date: Mon, 23 May 2022 10:13:05 -0500
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.9.0
Subject: Re: size and length
Content-Language: en-US
Newsgroups: comp.lang.c
References: <b3771529-f6ff-46b1-986b-616393240c34n@googlegroups.com>
<14155a82-32cf-44c5-998b-d663138e9407n@googlegroups.com>
From: NoO...@NoWhere.com (olcott)
In-Reply-To: <14155a82-32cf-44c5-998b-d663138e9407n@googlegroups.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Message-ID: <c7WdnV6VZO8eORb_nZ2dnUU7_81g4p2d@giganews.com>
Lines: 31
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-75rCsu1RqLSnuBrQpHIukNfaEsPM6mr57TQsxtHDavBs03TzqAcAMCzHDyGlfHmynx6sSQQuzdwEdyh!qonEfD7Z4AozDDnFz4U6Q1givOKsmSwHqZVCJ6+X3a2ZE4TxHERmgbzyxqEtSrDvcqhvuZ93ibU=
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 2504
X-Received-Bytes: 2595
 by: olcott - Mon, 23 May 2022 15:13 UTC

On 5/22/2022 7:17 PM, Malcolm McLean wrote:
> On Saturday, 21 May 2022 at 12:39:30 UTC+1, fir wrote:
>> writing dynamic arys i noticed one thing (not even noticed but like
>> bumped my head on it):
>>
>> imo the size is probably appriopriate name for axemple on this
>> what realloc takes this is teh size of ram allocked (for example 1 MB)
>> -when to know length of such array you need to know the size of
>> its basic element, for example if this is array of ints the length would
>> be 256*1024
>>
>> im not sure if this division of those two separate meanings is official
>> in computer science, doeas maybe some knows something on it?
>>
> A lot of languages don't make it easy to determine the number of bytes
> used by an array. So there's no convention that "size" represents a
> number of bytes whilst "length" represents a number of elements.
>
> If would make sense for C, but the C++ standard template library uses
> "szie" for a count, so that ship has sailed.

std::vector<int> array;
int bytes = sizeof(int) * array.size();
That makes the most sense to me.

--
Copyright 2022 Pete Olcott

"Talent hits a target no one else can hit;
Genius hits a target no one else can see."
Arthur Schopenhauer

Re: size and length

<5a0b603f-c830-44b9-b133-a2262de63f6en@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21723&group=comp.lang.c#21723

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a37:8946:0:b0:6a3:6f23:d6fd with SMTP id l67-20020a378946000000b006a36f23d6fdmr5841914qkd.766.1653318957376;
Mon, 23 May 2022 08:15:57 -0700 (PDT)
X-Received: by 2002:a05:622a:6082:b0:2f1:1f9c:251e with SMTP id
hf2-20020a05622a608200b002f11f9c251emr16762587qtb.230.1653318957201; Mon, 23
May 2022 08:15:57 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!feeder1.cambriumusenet.nl!feed.tweak.nl!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Mon, 23 May 2022 08:15:56 -0700 (PDT)
In-Reply-To: <14155a82-32cf-44c5-998b-d663138e9407n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.245; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.245
References: <b3771529-f6ff-46b1-986b-616393240c34n@googlegroups.com> <14155a82-32cf-44c5-998b-d663138e9407n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <5a0b603f-c830-44b9-b133-a2262de63f6en@googlegroups.com>
Subject: Re: size and length
From: profesor...@gmail.com (fir)
Injection-Date: Mon, 23 May 2022 15:15:57 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: fir - Mon, 23 May 2022 15:15 UTC

poniedziałek, 23 maja 2022 o 02:17:26 UTC+2 Malcolm McLean napisał(a):
> On Saturday, 21 May 2022 at 12:39:30 UTC+1, fir wrote:
> > writing dynamic arys i noticed one thing (not even noticed but like
> > bumped my head on it):
> >
> > imo the size is probably appriopriate name for axemple on this
> > what realloc takes this is teh size of ram allocked (for example 1 MB)
> > -when to know length of such array you need to know the size of
> > its basic element, for example if this is array of ints the length would
> > be 256*1024
> >
> > im not sure if this division of those two separate meanings is official
> > in computer science, doeas maybe some knows something on it?
> >
> A lot of languages don't make it easy to determine the number of bytes
> used by an array. So there's no convention that "size" represents a
> number of bytes whilst "length" represents a number of elements.
>
> If would make sense for C, but the C++ standard template library uses
> "szie" for a count, so that ship has sailed.

i wouldnt say it sailed .. but if there us as you say it may mean people dont notice
the difference and this difference possibly should be noticed more wide

Re: size and length

<3e08579f-bbf4-4fed-927d-d00425d879c4n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21724&group=comp.lang.c#21724

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:6214:1c83:b0:443:6749:51f8 with SMTP id ib3-20020a0562141c8300b00443674951f8mr17433989qvb.74.1653319119118;
Mon, 23 May 2022 08:18:39 -0700 (PDT)
X-Received: by 2002:a37:c58:0:b0:6a3:2a71:9904 with SMTP id
85-20020a370c58000000b006a32a719904mr14558895qkm.33.1653319118847; Mon, 23
May 2022 08:18:38 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Mon, 23 May 2022 08:18:38 -0700 (PDT)
In-Reply-To: <c7WdnV6VZO8eORb_nZ2dnUU7_81g4p2d@giganews.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.245; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.245
References: <b3771529-f6ff-46b1-986b-616393240c34n@googlegroups.com>
<14155a82-32cf-44c5-998b-d663138e9407n@googlegroups.com> <c7WdnV6VZO8eORb_nZ2dnUU7_81g4p2d@giganews.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <3e08579f-bbf4-4fed-927d-d00425d879c4n@googlegroups.com>
Subject: Re: size and length
From: profesor...@gmail.com (fir)
Injection-Date: Mon, 23 May 2022 15:18:39 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: fir - Mon, 23 May 2022 15:18 UTC

poniedziałek, 23 maja 2022 o 17:13:26 UTC+2 olcott napisał(a):
> On 5/22/2022 7:17 PM, Malcolm McLean wrote:
> > On Saturday, 21 May 2022 at 12:39:30 UTC+1, fir wrote:
> >> writing dynamic arys i noticed one thing (not even noticed but like
> >> bumped my head on it):
> >>
> >> imo the size is probably appriopriate name for axemple on this
> >> what realloc takes this is teh size of ram allocked (for example 1 MB)
> >> -when to know length of such array you need to know the size of
> >> its basic element, for example if this is array of ints the length would
> >> be 256*1024
> >>
> >> im not sure if this division of those two separate meanings is official
> >> in computer science, doeas maybe some knows something on it?
> >>
> > A lot of languages don't make it easy to determine the number of bytes
> > used by an array. So there's no convention that "size" represents a
> > number of bytes whilst "length" represents a number of elements.
> >
> > If would make sense for C, but the C++ standard template library uses
> > "szie" for a count, so that ship has sailed.
> std::vector<int> array;
> int bytes = sizeof(int) * array.size();
> That makes the most sense to me.
>
for me its nonsense (in te context said) should be > int bytes = sizeof(array[0]) * array.length();

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor