Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Coffee corner » important note when a strange compilation error occurs
Re: important note when a strange compilation error occurs [message #57298 is a reply to message #57297] Sun, 27 June 2021 17:49 Go to previous messageGo to previous message
Klugier is currently offline  Klugier
Messages: 1076
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello,

According to the standard following line is valid code:
void getTiposCartao(){;

You are opening function scope and add empty instruction. Please noticed that you can place whatever number of semicolons as you want:
void getTiposCartao(){;;;;;;; // <- valid


Why it is so? In C/C++ you are not force to write instruction per line - it is good habbit, but you have flexibility:
void getTiposCartao(){int a = 4;++a;int b = a + 10;for(int i = 0; i < 10; ++i){};;;} // <- You could process universe in the single function ;)


For the readability reason nobody should write code like this... This is not something we could fix within TheIDE. It is how the language is defined.

On the other hand following code:
function abc() };

is invalid due to parenthesis mismatch.
Klugier


U++ - one framework to rule them all.

[Updated on: Sun, 27 June 2021 17:52]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Compile under Mac M1 for intel
Next Topic: Do we have a QR image generator?
Goto Forum:
  


Current Time: Sat Apr 20 05:13:56 CEST 2024

Total time taken to generate the page: 0.02487 seconds