T
Tommi =?UTF-8?B?TcOka2l0YWxv?=
Hi,
what is the type of sizeof?
Here is some lines of code from a programm, which I'm porting to x86-64:
char buffer[512];
unsigned size = content_size;
while (size > 0
&& (in.read(buffer, std::min(sizeof(buffer), size)), in.gcount() > 0))
...
This does not work, because sizeof(buffer) is not of type unsigned. My
complier (g++-3.3 on linux) tells me:
error: no matching function for call to `min(long unsigned int,
unsigned int&)'
So what is the right (and portable) type to use here?
Tommi
what is the type of sizeof?
Here is some lines of code from a programm, which I'm porting to x86-64:
char buffer[512];
unsigned size = content_size;
while (size > 0
&& (in.read(buffer, std::min(sizeof(buffer), size)), in.gcount() > 0))
...
This does not work, because sizeof(buffer) is not of type unsigned. My
complier (g++-3.3 on linux) tells me:
error: no matching function for call to `min(long unsigned int,
unsigned int&)'
So what is the right (and portable) type to use here?
Tommi