error C2228: left of '.mazhe' must have class/struct/union type 是C++中常见的一种类型使用错误而产生的编译报错:"'.mazhe'的左边必须是类、结构、联合体之一" , 使用点(.)或箭头(->)引用变量时,操作符左边必须是以上三种数据类型的变量才可以 针对本题:在使用结构体类型数据时,要先...
The operand to the left of the period (.) is not a class, structure, or union. The following sample generates C2228: // C2228.cpp int i; struct S { public: int member; } s, *ps = &s; int main() { i.member = 0; // C2228 i is not a class type ps.member = 0; // ...
error C2228: left of '.move' must have class/struct/union type#include<iostream.h> class TDarray { int a[3][3]; public: TDarray(int x[3][3]) { for(int i=0;i<3;i++) { for(int j=0;j<3;j++) { a[i][j]=x[i][j]; } } } void move() { int temp; for(int h...
【题目】error C2228: left of '.move'must have class/struct/union type#includeiostream hclass T Darray { int a[3][3]; public: T Darray(int x[3][3]) { for(int i=0 i3 ;i++) { for(intj=0 j3 ;j++){a[i][j]=x[i][j];}}}void move() { int temp; for(int h=0; ...
left of '->date'must point to class/struct/union 错误的原因是:指针类型变量才能使用->引用操作符 e:\1.cpp(35):error c2228:left of '.tag'must have class/struct/union type 错误的原因是:非指针结构体变量.引用操作符,也就是.tag左边的变量不是指针变量 struct node结构体在哪里?
using namespace std;template <class T> struct LinkNode{ T data;LinkNode<T> *Link;LinkNode(LinkNode<T> *ptr=NULL){Link=ptr;} LinkNode(const T& item,LinkNode<T> *ptr=NULL){ data=item; Link=ptr;} };template<class T> class List{ public:List(){first=new LinkNode<T>;...
编译时有一个错误:error C2228: left of '.display' must have class/struct/union type习题程序为:#include <iostream>using namespace std;class date{public:date(int,int,int);date(int,int);date(int);date();
error C222..CRect rect;//想给这个矩形赋值Gxiang.TiRect(&rect); bool CGxiang::TiRect(CRect * rect){rect.left=0; //这里
error C2228: left of '.AddTail'must have class/struct/union type 不知問題出在哪邊 trace好久還是找不出原因 已經有#include <afxtempl.h> 以下是程式碼部分 TCHAR title[MAX_LEN]; TCHAR titlestring[MAX_LEN]; if (IsWindowVisible...
(x86)\Microsoft Visual Studio\MyProjects\dss\a.cpp(22) : error C2228: left of '.name' must have class/struct/union type 定位出错的地方,这句话的意思是说.name左边需要类、结构体或者联合 2、printf("%s%s\t%f\t",stu[i].name,stu[i].sex,stu[i].age);3、i,j定义为int ...