I have this C++ code:
#include <iostream>
using namespace std;
struct MyItem
{
int value;
MyItem* nextItem;
};
int main() {
MyItem item = new MyItem;
return 0;
}
And I get the error:
error: conversion from `MyItem*' to non-scalar type `MyItem' requested
Compiling with g++. What does that mean? And what's going on here?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…