What is the difference between int64 and int64_t in C++?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-20 17:34:39

问题


I am new to c++ and coding in general. so this question might be noobish. what is the difference in using type int64 or int64_t. I saw that one of the software devs modified their source on github and all of the int64 to int64_t.


回答1:


int64_t is a Standard C++ type for a signed integer of exactly 64 bits. int64 is not a standard type.

The first C++ standard didn't have fixed-width types. Before int64_t was added to Standard C++, the different compilers all implemented a 64-bit type but they used their own names for it (e.g. long long, __int64, etc.)

A likely series of events is that this project originally would typedef int64 to the 64-bit type for each compiler it was supported on. But once compilers all started to support Standard C++ better, or once the person who wrote the code found out about int64_t, the code was switched over to use the standard name.



来源:https://stackoverflow.com/questions/26582049/what-is-the-difference-between-int64-and-int64-t-in-c

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!