7

I´ve seen this in many popular C-Projects e.g the Go language and nowhere i can find some information about it. I think it is a kind of namespacing but i thought C doesn´t support it.

e.g

void runtime·memhash(uintptr*, uintptr, void*);

Thanks.

1

1 Answer 1

11

· is not a part of the "basic execution character set", and thus is not a standard C operator.

However, it does appear that the C standard allows it as an implementation-defined identifier character. It has no special meaning; it's just another character.

7
  • it looks like it may just be something their editor is displaying in the code base... Commented Mar 13, 2013 at 20:54
  • 3
    Don't have the C Standard handy, but the C++ Standard allows additional implementation-defined characters from a specified set of Unicode characters to be present in identifiers (2.11 and appendix E). U+00B7 is listed as allowed in appendix E.
    – aschepler
    Commented Mar 13, 2013 at 21:01
  • @aschepler: It seems C11 does as well (in annex D.1). Updated.
    – cHao
    Commented Mar 13, 2013 at 21:09
  • 1
    @DustinDeus: The answer is, it's just a funky character in a name, akin to $ in JS and Java, that some compilers allow. in whatever compiler(s) the code was made to run in. C doesn't give it any meaning other than that, and doesn't even require that compilers accept it. But for compilers that do, it provides a character that obviously makes people stop and say "hey, these two parts are separate", even if they also ask "what's that thing separating them? What operator is this?" :)
    – cHao
    Commented Mar 15, 2013 at 11:24
  • 1
    @DustinDeus: I personally can't recommend it, as (1) there's no guarantee the code will even run on all compilers that could otherwise compile it, and (2) as you yourself have proven, there will be people who are familiar with C but nonetheless wonder WTF is going on -- which is not a good thing.
    – cHao
    Commented Mar 15, 2013 at 14:52

Your Answer

By clicking “Post Your Answer”, you agree to our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.