int *和int之间有什么区别[size]

时间:2015-12-21 11:11:51

标签: c

function registerTools() {
    extractors = fs.readdirSync(extractorPath).filter(function(extractor) {
      return extractor !== "temp";
    });

    totalExtractors = extractors.length;
    extractors.map(function(item) {
      var fullExtractorPath = path.join(extractorPath, item);
      return require(fullExtractorPath);
    }).forEach(function(extractor) {
      if (extractor.test) {
        testExtractor(extractor);
      } else {
        satisfiedExtractors++;
        registerExtractor(extractor);
      }
    });
}

var registerExtractor = function(extractor) {
    if (extractor.extensions) {
      extractor.extensions.forEach(function(ext) {
        extensionExtractors[ext] = extractor.extract;
      });
    }
};

以上两个代码段返回不同的输出,

    第一种情况
  • Case I: int a[12]; printf("%d",sizeof(a)); Case II: int *a = (int *)malloc(12*sizeof(int)); printf("%d",sizeof(a));
  • 48在第二种情况下

为什么会这样?

0 个答案:

没有答案