摘要:
12.1 #include "cow.h" #include <iostream> #include <cstring> using std::cout; using std::endl; Cow::Cow() { name[0] = '\0'; hobby = new char[1]; hobby 阅读全文
摘要:
#include <iostream> using std::ostream; using std::istream; class String { private: char * str; int len; static int num_strings; static const int CINI 阅读全文
摘要:
答案 2.答案 7. 11_7_complex0.h #ifndef E11_7_COMPLEX0_H #define E11_7_COMPLEX0_H #include <iostream> class Complex { private: double m_a; double m_c; publ 阅读全文
摘要:
double calcMax (double arr[], unsigned arrSize) { unsigned idxMax = 0; for (unsigned i = 0; i arr[idxMax]) { idxMax = i; } } retur... 阅读全文
摘要:
Using a constructor to reset an objectConstructor using Nifty Foods calledBye~, Nifty Foods! //注意这里是析构了临时对象,临时对象是由于stock1 = Stock("Nifty Foods", 10, 5 阅读全文
摘要:
// require user to enter name and handicap, if the name is exist, then return 1, or return 0.int setgolf(golf & g){ string temp; cout << "Name: "; get 阅读全文
摘要:
1、函数的parameter和返回类型必须与相对应的函数指针类型一致。 2、如果(*pf)是函数,那么pf就是该函数的指针。 注意 double (*pf) (int); 是指 pf指向一个返回double类型的函数。 double *pf(int); 指 pf()函数返回一个double类型的指针 阅读全文
摘要:
Here is the official key below: 阅读全文
摘要:
#include <iostream> using namespace std; int Fill_array(double arr[], int n) { int count = 0; cout << "Enter your price: "<< endl; for(int i =0; i < n 阅读全文
摘要:
#include<iostream> using namespace std; const int ARSIZE = 10; void show_mark(float s) { cout << "Your average score is: "<< s << endl; } float avg(fl 阅读全文