急急急!!!!求助:关于string类型赋值时的错误
#include<iostream>#include<string>using namespace std;struct JOB{ string jobname; int time;};JOB job[5]={"null",0,"job1",15,"job2",8,"job3",3,"job4",10};报错如下:error C2440: ✀initializing✀ : cannot convert from ✀char [5]✀ to ✀struct JOB✀为什么?我改成用char数组来定义jobname就没错了,为什么不能用string?我刚改了,还是不行:#include<iostream>#include<string>using namespace std;struct JOB{ string jobname; int time;};JOB job[5]={{"null",0},{"job1",15},{"job2",8},{"job3",3},{"job4",10}};报错:error C2440: ✀initializing✀ : cannot convert from ✀char [5]✀ to ✀struct JOB✀