其他头文件中的类?

Mys*_*Dev 2 c++ class

我在main.cpp的另一个.h和.cpp文件中有一个类.

在main.cpp中:

#include <iostream>
#include "filestuff.h"
#include "stream.h" <-- right here

int main(int argc, char** args)
{
    if(!args[1])
        return 0;

    u64 filesize = 0;
    get_file_size(args[1], &filesize);
    u8* fd = new u8[filesize];
    read_file(args[1], fd, filesize);

    Stream s = new Stream(fd, filesize, "rb", BigEndian );

    getchar();
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

在Stream.h中

#include <iostream> //just in case?

#if defined(_WIN32) && defined(_MSC_VER)
    typedef __int64 s64;
    typedef unsigned __int64 u64;
#else
    typedef long long int s64;
    typedef unsigned long long int u64;
#endif

typedef unsigned long int u32;
typedef signed long int s32;
typedef unsigned short int u16;
typedef signed short int s16;
typedef unsigned char u8;
typedef signed char s8;

#define LittleEndian 0x1
#define BigEndian 0x2

class Stream
{
public:
    Stream(u8* buffer, u64 length, char* access, int IOType);
private:
    u8* buffer;
    u64 pos;
    u64 len;
};
Run Code Online (Sandbox Code Playgroud)

在Stream.cpp中

#include "stream.h"

Stream::Stream(u8* buffer, u64 length, char* access, int IOType)
{
    u8* buf = new u8[length];
    buffer = buf;
}
Run Code Online (Sandbox Code Playgroud)

我如何使用以下代码来初始化我的类,就像我main现在想做的那样?

Stream* s = new Stream(fd, filesize, "rb", BigEndian );
Run Code Online (Sandbox Code Playgroud)

cah*_*ahn 6

真正的错误在于#define LittleEndian = 0x1.删除=.