sizeof

    8

    2答えて

    私は次のコードを有する: type TRecord1 = record myarr: array [0..31] of single: end; type TRecord2 = record b1, b2, b3, b4, b5, b6: byte; end; type TRecord3 = record myarr: array [0..31] of sin

    2

    4答えて

    私はchar *とchar []の違いを知っています。 char x[] = "xxxx" 文字の配列です。 char *y = "xxxx" は、リテラル(const)文字列へのポインタです。 およびx[4]=='\0'および*(y+4) == '\0'もあります。 だからなぜsizeof(x)==5とsizeof(y)==4?

    1

    1答えて

    I有しメンバーのようないくつかのベクターを有する構造体:構造体の内部に my_struct A; ベクター(複数可): struct my_struct { std::vector<int> x; // more members here }; とmy_structのインスタンスを明らかに、このような A.x.resize(...); または Axpushなどのステート

    1

    5答えて

    の大きさはどのようなものですあなたが参照型 int&の物理的な大きさの話をしている、それはほぼ確実だろうと仮定すると、 int y = 10; // the size of y is 4 bytes int & x = y; // what is the size of x that receives the address of y

    1

    2答えて

    可能性の重複: Why isn't sizeof for a struct equal to the sum of sizeof of each member? 出力が8である理由? not sizeof(int)+sizeof(char) = 5? class CBase { int a; char p; }; int main() { cout<<"si

    3

    3答えて

    以下のコードを使用してLPTSTR変数およびCONST CHAR変数のサイズを取得しようとしていますが、適切なサイズを取得できません。 私は20を得るはずですが、const char *変数で0、LPTSTR変数で4が得られます。私は次の関数を使用してバイナリデータとしてWindowsレジストリに挿入する値のサイズ( REG_BINARY)を取得する必要があります const char *var1

    6

    3答えて

    ルック使用char配列のサイズ:sizeof(char)けれども char a1[] = {'a','b','c'}; char a2[] = "abc"; cout << sizeof(a1) << endl << sizeof(a2) << endl; なぜ場合のように(4なく3として出力ショーsizeof(a2)を行い、1バイトでありますa1)?

    2

    1答えて

    にC構造体のマーシャリング: typedef struct tagTEXTUREPROP { DWORD dwSize; DOUBLE eGloss; DOUBLE eContrast; BOOL bRepeat; DOUBLE eDropX; DOUBLE eDropY; DOUBLE ePlacingPointX;

    45

    4答えて

    可能性の重複: size of int, long, etc Does the size of an int depend on the compiler and/or processor? What decides the sizeof an integer? 私は64-bitマシンを使用しています。私は、次のプログラムを実行したとき $ uname -m x86_64 $ file /us

    4

    3答えて

    私は、貧しい人のシングルトンの一種として機能する静的属性のみからなるクラスを持っています。その目的は、アプリケーションのさまざまなポイントから統計を収集することです。私たちの単体テストでは、運用コード内の違いを取得するために使用できるシャドウコピーを作成しました。 例: struct Production { static ComplexClass value1; static