This is a snippet from my video on the C Iceberg. Here I demonstrate C’s “digraphs” and “trigraphs,” which let you replace curly and square brackets with combinations of other characters.
source
This is a snippet from my video on the C Iceberg. Here I demonstrate C’s “digraphs” and “trigraphs,” which let you replace curly and square brackets with combinations of other characters.
source
wow, learn something new every day. cool
<: :3 :>
Actually you can use a program to print all chars on a text file then copy paste them or write code that adds them autonomously😅
That looks funny 🤣
gcc will throw an error on trigraphs unless you enable this feature by -trigraphs
the type of shit you see at the end of the 6th interview round .
writing C for 40 years and didn't know that?
It should've been <:4:> not <:3:>.
finally
int main() <?php
?>
Useless? Very useful for trolling
Finally understood why is ruby on rails codes like that
hot take: digraphs actually look kinda neat
:3
i swear it said c supports black people
Digraphs are still supported in C++. Unfortunately, Bjarne must have forgotten about them when he introduced the :: operator, because until 2012 you couldn't write the otherwise perfectly valid syntax A<::B> (a templated class A with a template argument B from the global namespace) as it would be turned into A[:B> .
A special rule had to be added to the C++ tokenizer to fix this; now, when the tokenizer encounters the sequence <:: it checks whether the next character is a colon. If it is, <:: becomes [: . If it isn't, it then checks if the next character is >, and if it isn't, <:: becomes [:
The things the C++ standards team will put themselves through just for backward compatibility…
I could use find and replace to make our whole codebase more readable?
Brooooooooo, 😂😂😂where do you get this information from?
If key boards did not have that symbol then why they used these symbols in the first place to make a language?
Some of this things are not working in modern standards
I thought these got removed in some standard or other.
That's also why in c++ you can use "int foo<%12%>;" in case you have a personal vendetta against the equals sign.
I'm writing a C compiler and I just noticed digraphs. You just transform them to the same token as their canonical one. It isn't that hard to handle it
So i can write encrypted c coding which even some elite coders cant decrypt without the rules
Los que hayan programado JSPs en java se acordarán mucho de <% %>
um no this is not useless, its very nice for my broken keyboard and if you really hate it you can write a 2 line sed script to replace the digraphs and trigraphs with their original symbols
Now how can I write "|" when my keyboard doesn't have a button for it?
It isn't useless even nowadays, if some OEM for whatever reason have opted not to include those symbols — and yes, there are such keyboards even nowadays, including touchscreens (with restrictions upon 3rd-party and your own alternatives).
Oddly enough some have opted to remove the following: < | >
C++ removed trigraphs altogether in C++17.
This thing is still used in ejs and other templating languages right?!
"C is totally useless today". Dude is rage baiting out the gate lol
The code you've presented is valid c, however it triggers undefined behavior. You are attempting to initialize a char array of length 3 with a string literal of length 4
c is three assembler macros in a trenchcoat
Not any more, since C23. C17 had trigraphs https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2347.pdf but C23 have not https://www.iso-9899.info/n3220.html#5.2.1
When C was not an UTF-8/16 language
This video makes me :>
neat 👍
I'm pretty sure your C code has a bug since "Bob" as a string literal takes 4 chars to store it in an array. Need space for the null terminator…
new code obfuscation tech unlocked
shoutout to my GoAT ??/, which becomes a backslash
perfect for causing your comments to make the rest of the code tweak out 😀
need to poison the AI models so they start doing this in C code 😹
and also explain why early version of HTML used <? ?> or <% %> for ASP or PHP code(i don't remember who used what, I am too young). It appears, they just copied it.
Digraphs I've seen before, but shit, the trigraphs look quite cursed.
That is the nastiest thing I've seen all year.