Computer science: uint32 vs uint32_t

Self-tutoring about computer science: the tutor mentions a key difference in types.

I was reading in some documentation about a certain function with return type uint32. It means, to my understanding, “unsigned integer 32-bit,” so I wasn’t too surprised about it.

Although it did compile, my program was unhappy. One of the changes before the unhappiness arose had been the inclusion of the uint32 type. Yet, how could that be a problem? After all, it was from the documentation about the software library I was using(!)

Yet, the problem seems to have been the declaration of the uint32 type. It should be uint32_t. After I changed it to uint32_t, then recompiled, the program stopped failing.

Years ago my mechanic friend mentioned that even the literature specific to a piece of equipment will sometimes mis-document what you will see under the hood. “It’s not like it says in the manual,” he would claim. I discovered the same years later in a mechanical setting.

Source:

cplusplus.com

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.

Leave a Reply