16 AnswersNew Answer
16 AnswersNew Answer
Malik Hamza Nawaz read this thread for a more complete answer and I think it will help. https://www.sololearn.com/Discuss/650635/?ref=app
Malik Hamza Nawaz Based on what you wrote with no real explanation I'm going to say 2
Malik Hamza Nawaz Then my previous answer should be 4 and Ipang answered that in the thread Mentioned above. generally it is 2 with pointer 4 as @sayan mentioned
Ipang That was what Malik Hamza Nawaz mentioned above "Yes agreed so what is the architecture of solo learn compiler?"
4 bits of memory
Malik Hamza Nawaz It's not about in SoloLearn quiz or other place. Size of a type depends on language, compiler implementation (for compiled languages), and system architecture (a 16, 32 or 64bit machine). I think you may need to specify a relevant language in your thread tags, just to improve context clarity 👍
Malik Hamza Nawaz In regards to C or C++, the standards does not specify a strict definition. IIRC there is however a specification that defines that (cmiiw) size of char < short < int <= long < long long When it comes to size of integral types family. P.S. It is highly recommended to rely on `sizeof` operator rather than assumptions on type sizes : )
Yes agreed so what is the architecture of solo learn compiler?
Malik Hamza Nawaz Although I am not exactly sure, but considering today's demands of the SoloLearn platform, I would guess it uses 64bit machines. 32bit machines serving millions of users may require more work. 16bit machines may not even be capable. Still, would you mind specify a language in tags above?☝
BroFar Sir, my answer in that thread was solely based on Code Playground nature. In the end we know we better off to rely on `sizeof` operator : )
You can dry run a code in SoloLearn ide. Use sizeof() to get your answer. Although it depends on the question contributor. Generally now a days we use 4 byte for int.
Yes but now in 64 bit architecture the size is 4 bits
Oh sorry I forgot to mention that. I am considering C++
Thank you all.
Sololearn Inc.4 Embarcadero Center, Suite 1455
Send us a message