sizeof

    -4

    3답변

    우리는 모두 C 언어로 sizeof 연산자에 익숙합니다. 모든 종류의 데이터 형식을 흡수하고 크기를 반환하는 유사한 작동 함수를 만들려고합니다. "C"에서 이와 유사한 기능을 만드는 방법을 누군가가 말해 줄 수 있습니까? int myOwnSizeOf(/*what would be parameter type?*/) { //and what about

    16

    3답변

    에서 포인터의 크기를 가져 오기? 포인터를 저장하는 메모리를 malloc하고 싶습니다.

    0

    1답변

    가능한 중복 : How to find the sizeof(a pointer pointing to an array) Sizeof an array in the C programming language? #include<stdio.h> void doit(char x[10]){ printf("%d\n", sizeof(x)); } void main

    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 같은 문으로, 프로그램의 실행

    0

    4답변

    이유는 다음 코드에서 sizeof(X) == 4 및 sizeof(Y) == 8입니까? 또한 X 클래스에서는 멤버 함수가 메모리 공간을 차지하지 않는 이유는 무엇입니까? class X { int i; public: X() { i = 0; } void set(int ii) { i = ii; } int read() const

    2

    2답변

    나는 그물에 sizeof (str-1) 몇 시간을 보았지만 결코 그것을 사용하지 않았다. stf가 문자 배열 인 경우 sizeof (str-1)와 sizeof (str) -1의 차이점을 궁금합니다. char str [] = "Hello";

    37

    4답변

    #include "stdio.h" #include "string.h" main() { char string[] = "october"; // october is 7 letters strcpy(string, "september"); // september is 9 letters printf("the size of %s i

    2

    7답변

    는 : int main() { char **temp; printf("Size of **temp %d", sizeof(**temp)); printf("Size of *temp %d", sizeof(*temp)); printf("Size of temp %d", sizeof(temp)); return 0; }

    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 /usr/bin/file