Answer to Question #185807 in C++ for Chathu

Question #185807

Given reasons indicating why following identifiers are invalid,

1)goto

2)Struct

3)true

4)2k


1
Expert's answer
2021-04-27T09:36:51-0400

Goto statement: Goto statement gives the power to jump to any part of the program but it makes the program complex and tangled. But in the modern programming language, the goto statement is quite harmful construct and a bad programming practice.


Struct: It beats both performance and memory. Each call is a copy, any array of structures is almost guaranteed to fall into the Large Object Heap, which will once again hit both performance (due to increased GC time) and memory (a fragmented heap is very bad). The struct members can not be initialized with declaration. C program fails in compilation but it is considered correct in cpp and above.

True : the value of true and false have been added as keywords in cpp. The default numeric value of true is 1 and false is 0. We can use boolean type variables or values true and false in mathematical expression also.



Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS