C/C++ Is the Semicolon Used as a Statement Delimiter in C++?

  • Thread starter Thread starter mdnazmulh
  • Start date Start date
  • Tags Tags
    C++
AI Thread Summary
The semicolon (;) is confirmed as a statement terminator in C++. It allows multiple statements to be written on a single line, provided they are separated by semicolons. However, for the sake of program readability, it is generally advisable to avoid cramming too many statements into one line. The discussion emphasizes that while it's technically possible to write multiple statements in one line, maintaining legibility is crucial for effective coding practices.
mdnazmulh
Messages
51
Reaction score
0
Is the semicolon (;) used as statement delimiter in C++?

I have been knowing that semiclon is statement terminator.

Another confusion:
I think, we can write as many as statements we wish in a single line and of course separating them by semicolon. But to ensure program readability we don't do that.
Am I correct?
 
Technology news on Phys.org
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I had a Microsoft Technical interview this past Friday, the question I was asked was this : How do you find the middle value for a dataset that is too big to fit in RAM? I was not able to figure this out during the interview, but I have been look in this all weekend and I read something online that said it can be done at O(N) using something called the counting sort histogram algorithm ( I did not learn that in my advanced data structures and algorithms class). I have watched some youtube...
Back
Top