int main() { int& invalidRef; // error: references must be initialized int x { 5 }; int& ref { x }; // okay: reference to int is bound to int variable return 0; }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter