Firstly, if int
is a particular datatype, you should make sure it's formatted differently to other text to signify that you are talking about a specific datatype rather than integers in general. That's far more important than whether you use "array of int
s" or "int
array".
Personally I would argue in favour of "array of int
s" (or in the general case "array of integers"), because it's more formal and less ambiguous, both of which are reasonably important in technical writing. (As an added bonus, array of int
is actually valid syntax in certain programming languages.)
If you can't decide, one option is to introduce them as synonyms for each other - to explicitly tell the reader that "int
array" means the same as "array of int
s", after which you would be free to use either, as appropriate, without confusing the reader (because both terms have been explained).
In general, you're best off introducing the terminology that you're going to use before you use it just to make completely sure that your audience understands what you're talking about (people who are used to different languages may have different expectations). This has the added benefit of potentially making your document more accessible to people who are less familiar with the terminology, e.g. novice programmers.
int
. (Andint
is a signed type, so at most 2^31 elements for non-negative indices). I don't think that's a sensible reading of "int array", so I'm curious what mental context would lead to someone else finding that sensible. (Genuine question, not saying you're wrong.)int a, arr[8]
is list of declarations where the base type isint
, declaringa
as a scalarint
, andarr
as an array of 8int
elements. Since the element type comes first in C-like languages, it's pretty natural to end up with the English phrase "int array".