Limits on 32 and 64 bit in C++ / C

Hi All,

I am getting below run time error

I checked the code and see the structure defined as below and using the file position variable

typedef struct Get_file {
        char            *current_pathname;
        unsigned int    tot_bytes_io, physical_position;
        int file_position;
        int             remote;
        char            host[12];
        int             fd, open_mode;

the variable is a integer . I looked the binary and it was 32 bit compiled and the integer limit the output is saying is that. I did the compile in 64 bit. But I still see the issue . I am not sure why 64 bit compilation is not working

Thanks

This varies a bit among compilers, but in general, you get 64-bit types when you ask for them and otherwise are left with the same defaults as a 32-bit machine. Pointers of course become 64-bit on any architecture with a flat memory model.

Use size_t for sizes and positions, that's what it's there for. It will always be the right size of variable for whatever you're compiling on.

1 Like

Hi.

To see arithmetic characteristics of compiler and machine, consider enquire:

Enquire: Everything you wanted to know about your C Compiler and Machine, but didn't know who to ask

Best wishes ... cheers, drl

1 Like