本文整理汇总了C++中Student::getAddress方法的典型用法代码示例。如果您正苦于以下问题:C++ Student::getAddress方法的具体用法?C++ Student::getAddress怎么用?C++ Student::getAddress使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Student
的用法示例。
在下文中一共展示了Student::getAddress方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Search
void Database::Search(string sType, string sValue){
// simple but horribly inefficent search function
bool foundValue = false;
int size = Database::iTotalStudents;
for(int i = 0; i < size; i++){
Student newStudent = Student();
newStudent = Database::getStudentOffArray(i);
if(sType == "last"){
if(newStudent.getLastName() == sValue){
foundValue = true;
cout <<"\nFound a match for " << sValue << endl;
cout << newStudent;
}//end if
} else if (sType == "first"){
if(newStudent.getFirstName() == sValue){
foundValue = true;
cout <<"\nFound a match for " << sValue << endl;
cout << newStudent;
}//end if
} else if (sType == "city"){
Address newAddress = Address();
newAddress = newStudent.getAddress();
if(newAddress.getCity() == sValue){
foundValue = true;
cout <<"\nFound a match for " << sValue << endl;
cout << newStudent;
}//end if
}//end if
}//end for
if(!foundValue){
cout << "\n*****************************String not found." << endl;
}//end if
}//end method