Domanda

I've got a piece of C code:

Int32 tmp = atoi("314");

It throws an error:

error: Int32 undeclared (first use in this function)

I have no idea why? Could you help me?

Maybe it is problem with #includes:

  • sys/socket.h
  • netinet/in.h
  • arpa/inet.h
  • stdio.h
  • stdlib.h
  • string.h
  • strings.h
È stato utile?

Soluzione

There is no standard type called Int32. You're probably looking for

int tmp = atoi("314");

If you need a 32-bit integer, the standard type is int32_t defined in inttypes.h or stdint.h.

Altri suggerimenti

There is no built-in Int32 type in C. You can include stdint.h for int32_t and uint32_t though. But in this case, you probably want to use int.

int tmp = atoi("314");

If you want Int32 variable you should use

<arm.h>

Check this link. http://pubs.opengroup.org/onlinepubs/009619299/apdxa.htm

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top