Alex Rivera | Logout

Why are there digraphs in C and C++?

Asked 2009-01-11T06:07:20.640
87

I learned today that there are digraphs in C99 and C++. The following is a valid program:

%:include <stdio.h>

%:ifndef BUFSIZE
 %:define BUFSIZE  512
%:endif

void copy(char d<::>, const char s<::>, int len)
<%
    while (len-- >= 0)
    <%
        d<:len:> = s<:len:>;
    %>
%>

My question is: why do they exist?

Edit
Report

1 Answer

17

I think it's because some of the keyboards on this planet might not have keys like '#' and '{'.

answered 2009-01-11T06:11:31.383

Your Answer