
24.09.2008, 22:15
|
|
Познающий
Регистрация: 08.08.2008
Сообщений: 55
С нами:
9346084
Репутация:
54
|
|
дык buf - это указатель. он занимает 4(8) байтов. подробней - читай МСДН по поводу sizeof(). вот исчо исходник там есть в качестве примера
Example
Код:
// expre_sizeof_Operator.cpp
// compile with: /EHsc
#include <iostream>
size_t getPtrSize( char *ptr )
{
return sizeof( ptr );
}
using namespace std;
int main()
{
char szHello[] = "Hello, world!";
cout << "The size of a char is: "
<< sizeof( char )
<< "\nThe length of " << szHello << " is: "
<< sizeof szHello
<< "\nThe size of the pointer is "
<< getPtrSize( szHello ) << endl;
}
Output
The size of a char is: 1
The length of Hello, world! is: 14
The size of the pointer is 4
|
|
|