Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #163221

on ``vector'' and ``array''

From Meredith Montgomery <mmontgomery@levado.to>
Newsgroups comp.lang.c
Subject on ``vector'' and ``array''
Date 2021-10-29 01:00 -0300
Organization Aioe.org NNTP Server
Message-ID <8635oklbti.fsf@levado.to> (permalink)

Show all headers | View raw


I never call an array a vector because C89 doesn't even mention the word
vector in there, but C99 does in a silly example in section 6.7.3.  What
is your choice of terminology?  (What is an array?  What is a vector?)

(*) C99 section 6.7.3

--8<---------------cut here---------------start------------->8---
[...] For example, this permits new_vector to return a vector.

typedef struct { int n; float * restrict v; } vector;
vector new_vector(int n)
{
  vector t;
  t.n = n;
  t.v = malloc(n * sizeof (float));
  return t;
}
--8<---------------cut here---------------end--------------->8---

Look at this example.  They're really building a convenient data
structure there.  But is it well-named?

Vectors (to me) belong to a vector space and vector spaces have
well-defined dimensions.

Back to comp.lang.c | Previous | NextNext in thread | Find similar | Unroll thread


Thread

on ``vector'' and ``array'' Meredith Montgomery <mmontgomery@levado.to> - 2021-10-29 01:00 -0300
  Re: on ``vector'' and ``array'' Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2021-10-28 21:29 -0700
  Re: on ``vector'' and ``array'' Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2021-10-29 04:42 -0700
    Re: on ``vector'' and ``array'' Ben Bacarisse <ben.usenet@bsb.me.uk> - 2021-10-29 14:02 +0100
      Re: on ``vector'' and ``array'' Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2021-10-29 06:58 -0700
        Re: on ``vector'' and ``array'' Meredith Montgomery <mmontgomery@levado.to> - 2021-10-29 12:02 -0300
          Re: on ``vector'' and ``array'' Anand Hariharan <mailto.anand.hariharan@gmail.com> - 2021-10-30 09:33 -0700
            Re: on ``vector'' and ``array'' Meredith Montgomery <mmontgomery@levado.to> - 2021-10-30 15:29 -0300
            Re: on ``vector'' and ``array'' Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2021-10-30 13:25 -0700
              Re: on ``vector'' and ``array'' Meredith Montgomery <mmontgomery@levado.to> - 2021-10-31 12:02 -0300
        Re: on ``vector'' and ``array'' Ben Bacarisse <ben.usenet@bsb.me.uk> - 2021-10-29 16:38 +0100
    Re: on ``vector'' and ``array'' Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2021-10-29 11:08 -0700

csiph-web