c++ expression syntax error
来源:百度知道 编辑:UC知道 时间:2024/06/06 19:10:05
#include <iostream>
using namespace std;
#include "data.h"
int main(){
Data student();
student.readfile( "assign-5-data.txt" );
student.SelectionSort(student.getName(),student.getNumberOfStudent());
//print the data
student.printfile();
char a;
cout<<"Do you want to search for a name?(y/n)";
cin>>a;
cout<<endl;
if(!(a=='y' || a=='Y')) return 0;
cout<<"type the name please:";
const int Max = 51;
char* theName;
char buffer[Max];
//read the name to the buffer first
cin >> buffer;
//create an integer to save the length of the name
int nameLength;
//to find out the length
for(nameLength=0; buffer[nameLength]!='\0';nameLength++);
//create the porinter array the ri
using namespace std;
#include "data.h"
int main(){
Data student();
student.readfile( "assign-5-data.txt" );
student.SelectionSort(student.getName(),student.getNumberOfStudent());
//print the data
student.printfile();
char a;
cout<<"Do you want to search for a name?(y/n)";
cin>>a;
cout<<endl;
if(!(a=='y' || a=='Y')) return 0;
cout<<"type the name please:";
const int Max = 51;
char* theName;
char buffer[Max];
//read the name to the buffer first
cin >> buffer;
//create an integer to save the length of the name
int nameLength;
//to find out the length
for(nameLength=0; buffer[nameLength]!='\0';nameLength++);
//create the porinter array the ri
Data student();
你这是在申明一个函数而不是定义一个对象
在VC6,空构造定义对象,好像不能加括号
int main(){
Data student();
改为
int main(){
Data student;
Data student();
改为
Data student = new Data();
前者是声明一个方法,该方法返回一个Data类型的引用
后者才是声明引用并创建实例
expression syntax
C中编译出现“Expression syntax in function delete/Statement missing ; in function delete”.求救啊!
(猴急!)C语 在TC编译时出现错误提示 Expression syntax in function main
“Disappointed expression ”是什么意思?
expression是什莫意思 ,看下句
java logic expression
expression的意思
look expression 表情 区别
一个regular expression问题
expression可数吗