Sujet : Re: "array"
De : Ros (at) *nospam* invalid.invalid (Rosario19)
Groupes : comp.lang.cDate : 02. Apr 2025, 18:53:15
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <72uqujlo006r4ggh10rt94j158fpbqlm1e@4ax.com>
References : 1
User-Agent : Forte Free Agent 1.93/32.576 English (American)
On 2 Apr 2025 11:01:01 GMT, (Stefan Ram) wrote:
Below, an array is allocated dynamically.
>
#include <stdio.h>
#include <stdlib.h>
>
int main( void )
{ char *array_pointer = malloc( 10 * sizeof *array_pointer );
if( !array_pointer )return EXIT_FAILURE;
*array_pointer = 'a';
free( array_pointer ); }
>
But is it really an array according to the C spec?
>
C only defines "array type", not array, but it uses ISO/IEC 2382:2015
as a normative reference, and ISO/IEC 2382:2015 says:
Im not one expert...
i consider one array one contiguos succession of elements, where
elements have the sama type
and array has no type
or has the type "array of lements type T"