2

In programming every datum has some type. For example:

1, 2, 3, are of int type

'a', 'b', 'c' are of char type

'5/17/2019' is of Date type

I often see phrases like this one:

A variable of type char

Why is there no article before "type"?

  • 1
    This particular construction is brilliantly covered here on ELU. Briefly, both the indefinite article (a) and preposition (of) can be discarded in some contexts like those above (also note that idiomatically, we usually say Param1 is of type char, not ...of char type). But not in all contexts - of is required I'm writing a function that expects a parameter of type unknown, for example. – FumbleFingers Reinstate Monica Jun 22 '19 at 16:09
  • ...including the article (as in This parameter must be of a Date type) tends to imply there are multiple "Date type" storage formats - which exact "subtype" the parameter has to be is either unspecified OR irrelevant (because any of those Date subtypes is acceptable for this parameter). – FumbleFingers Reinstate Monica Jun 22 '19 at 16:15
  • I think the article being omitted, here, is actually "the", not "a". But that linked question answers it. – Len Jul 3 '19 at 0:04
  • @FumbleFingers Thank you, but the linked question doesn't say anything about articles, does it? It says only about omitting "of"... Could you please explain what did you mean? – embedc Sep 21 '19 at 9:25
  • The answer to that earlier question specifically gives two different example contexts - one for the indefinite article (It expects the parameter to be of a type not yet defined) and one for the definite article (It expects the parameter to be of the type we encountered in section 3.4). And discussing the formal syntactic constraints, StoneyB specifically says You need of and a determiner. Usually that "determiner" will be a definite or indefinite article, but in certain contexts other determiners (our, this, etc.) could also be used, – FumbleFingers Reinstate Monica Sep 22 '19 at 11:56
1

Why is there no article before "type"?

You're not really talking about a type, you are talking about a variable. Variable already has an article.

-1

I think it is just placing mistake, it should be "a variable of char type" meaning that the variable type (data type) is CHAR

You can see this link as reference http://cis.poly.edu/~mleung/CS1114/s09/ch02/char.htm

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.