Why would we put a block of code inside braces? [duplicate]

This question already has an answer here:

I came across this C code that I can’t explain to myself:

 check_eeprom_data();
 {

     unsigned char serial_num[5];
     printStr("nSerNUM:");
     eeprom_read(confEE_SERIAL_NUM, serial_num, 5);
     printBuffAsHex(serial_num, 5);

 }

Why are these curly brackets needed to enclose this part of the code? What makes it different if there were no brackets?


Source: syntax

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.