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


Groups > comp.lang.c > #140495 > unrolled thread

Re: Didactic "white lies"

Started byAnton Shepelev <anton.txt@gmail.com>
First post2019-02-03 18:57 +0300
Last post2019-02-04 12:15 +0300
Articles 2 — 2 participants

Back to article view | Back to comp.lang.c

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Didactic "white lies" Anton Shepelev <anton.txt@gmail.com> - 2019-02-03 18:57 +0300
    Re: Didactic "white lies" Anton Shepelev <anton.txt@g{oogle}mail.com> - 2019-02-04 12:15 +0300

#140495 — Re: Didactic "white lies"

FromAnton Shepelev <anton.txt@gmail.com>
Date2019-02-03 18:57 +0300
SubjectRe: Didactic "white lies"
Message-ID<20190203185707.98537e7aefe86b8a08dfdbba@gmail.com>
Stefan Ram:

> One white lie I tell at the beginning of my C course, when
> the proper treatment of pointers still is in a remote
> distance:
>
> To explain "char *": "char" means "character", and the "*"
> means the preceding thing can be repeated arbitrarily
> often, so "char *" means "a sequence of characters". -
> Explanation without the need to speak of anything that was
> not treated yet.

Can't you limit string manuipulation to arrays

  char s[255];

and indexing

  char c;
  c = s[14];

before you move on to pointers?

My 8-bit editor cannot handle you quotation marks.

-- 
()  ascii ribbon campaign -- against html e-mail
/\  http://preview.tinyurl.com/qcy6mjc [archived]

[toc] | [next] | [standalone]


#140508

FromAnton Shepelev <anton.txt@g{oogle}mail.com>
Date2019-02-04 12:15 +0300
Message-ID<20190204121544.021d8c042d3a2b2cafc0638b@g{oogle}mail.com>
In reply to#140495
Stefan Ram to Anton Shepelev:

>>Can't you limit string manuipulation to arrays
>>
>>  char s[255];
>>
>>and indexing
>>
>>  char c;
>>  c = s[14];
>>
>>before you move on to pointers?
>
>In the beginner's course, I do not do any string
>manipulation, except for printf-printing using a format
>with conversion specifications. (So, e.g., "printf( "%s%s",
>"a", "b" )" is a kind of concatenation.)

I suggest to avoid the use of `*' until it is property
introduced.  You can work with arrays and string literals.

>For the advanced course, I just have started to write an
>explanation of addresses in C, and I would base the
>explanation of arrays and strings on that then.

And until then, both arrays and strings may be considered
abstract black-box types.

>But the demand for C and C++ at the adult education centers
>where I work is falling, and it is well possible that I
>will not give any C and C++ classes anymore comes 2020.
>(Instead people now like to learn Java and Python, which I
>teach too. So I still have something to do.)

That's a shame, now that they are "compiling" Python into C
instead of making something efficient from the start.

-- 
()  ascii ribbon campaign - against html e-mail
/\  http://preview.tinyurl.com/qcy6mjc [archived]

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.c


csiph-web