Continues to say that uint16 is not announced

Well, I know that this should be a simple question, but for life I can’t understand why I keep receiving this message. I am using eclipse V3.8 on ubuntu linux V13.04

The compilation says: "unit16 has not been declared

#ifndef ENIGMA_2C_H_
#define ENIGMA_2C_H_

class Enigma2C {

public:
    static bool checkOptionKey(uint16 option, char *key);
    static bool encrypt (char *inString, char *outString);
    static bool decrypt (char *inString, char *outString);
};

#endif
+4
source share
2 answers

Use uint16_tin cstdint, which is introduced in C ++ 11. Or define your own type.

For C, it is in stdint.h, which is entered in C99.

+10
source

You need to include inttypes.hanf type uint16_t. i.e

#ifndef ENIGMA_2C_H_
#define ENIGMA_2C_H_

#include <inttypes.h>

class Enigma2C {

public:
    static bool checkOptionKey(uint16_t option, char *key);
    static bool encrypt (char *inString, char *outString);
    static bool decrypt (char *inString, char *outString);
};

#endif
0
source

All Articles