Gentoo Archives: gentoo-user

From: Fernando Rodriguez <frodriguez.developer@×××××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Re: systemd-224 Look out for new networking behavior [FIXED]
Date: Tue, 04 Aug 2015 03:03:21
Message-Id: BLU436-SMTP75A700D1D1631C6AA5678D8D760@phx.gbl
In Reply to: [gentoo-user] Re: systemd-224 Look out for new networking behavior [FIXED] by walt
1 On Monday, August 03, 2015 6:41:22 PM walt wrote:
2 > That line declares *hostname as a constant and then the statement below
3 > proceeds to assign a value to the 'constant'. I wonder how many hours
4 > of frustration have been suffered by student programmers while trying to
5 > understand the logic behind that.
6
7 Because it's not a constant, it's a pointer-to-constant :)
8
9 const char *hostname; /* pointer to constant char */
10 char *const hostname; /* constant pointer to char */
11 const char *const hostname; /* constant pointer to constant char */
12
13 Is that confusing enough?
14
15 --
16 Fernando Rodriguez

Replies

Subject Author
Re: [gentoo-user] Re: systemd-224 Look out for new networking behavior [FIXED] Franz Fellner <alpine.art.de@×××××.com>