sizeof int is platform dependent and varies from platform to platform. while sizeof long is always 32-bit
A platform is not specifically an OS, it is the 'host' environment. A 32-bit OS, with an old C compiler may carry int to be of size 16. Now you can figure out what to use where. Depends on the scenario where to use what ... if you need yashpal_ait21 wrote: > Hi C-programmers, > Can you please clarify this doubt to me related with 'int' > and 'long' data type in C++? When should a programmer use 'int' and > when should he use 'long'? What is the need of datatype 'long', > when 'int' & 'long' are both 32-bit quantities on a 32-bit OS ? > > Regards, > Yashpal > > >
