スポンサード リンク
Microsoft Visual C++にて以下のソースでコンパイルエラーが発生します:
コンパイルエラーメッセージ:
error C2528: 'abstract declarator': 参照へのポインターは無効です。
ソース(バグ有り):
#include <stdio.h>
#include <stdlib.h>
#define NUM_OF_INT 100
int main()
{
int i;
int *heap;
heap = (int *)malloc(sizeof(int& * NUM_OF_INT);
if (heap == NULL)
{ |
ソース(修正済み):
#include <stdio.h>
#include <stdlib.h>
#define NUM_OF_INT 100
int main()
{
int i;
int *heap;
heap = (int *)malloc(sizeof(int) * NUM_OF_INT);
if (heap == NULL)
{ |
スポンサード リンク