In c data type structure is present ,structure allow to use different data type like int,char in the same program,my question is ,is structure return any value ?if it return any value what is the reason,if structure not return any value than what is the reason behind this.please reply
I am new member so i do not know any thing about crazy engineer.if i asked any thing wrong then please correct me.
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a
member of our community. Consider creating an
account or login.
Structure cannot return value since it is a user defined data type.
It contains the collection of heterogenous data type means different data type like int,char,float evan arays and other structures
and its only a logical concept.
I declared a variable as âintâ data type for a PatientId. It worked fine in local, but when that code went to LIVE, the application gave exception because in LIVE PatientId is too long to accommodate in int data type.
So before declaring any variable we need to consider all the situations, application scope, environment .Even one code may be working fine today, after 1/ 10/20 days/months/years it will fail due to just due to data type declaration mistake.
Think more; write less is the policy for better programming.
My Experience No 2:
I declared a variable as int data type which was a placeholder for a result status (meaning, based on the result status that variable varies from 0/1/2/3. It can contain only these four values).
âintâ data type is 4 byte integer in C#. But I can declare this variable as âsbyteâ which represents a 1 byte integer. Since that variable contains only 1 or 2 or 3 or 4, declaring the variable as âintâ is wastage of memory space.
Before declaring any variable we need to just think of the memory space needed for that variable, our requirement, any other good alternative for this variable.