
作業社區
探索學習新天地,共享知識資源!
幕布斯3194744 的學生作業:
#ifndef __STRCC_HEAD__ #define __STRCC_HEAD__ #ifdef __cplusplus extern "C"{ #endif extern char *str_cat(char *dest,const char *source); extern char *str_cpy(char *dest,const char *source); #ifdef __cplusplus } #endif #endif #include #include char *str_cpy(char *dest,const char *source) { char *p1 = dest; while(*source){ *dest++ = *source++; } *dest = '\0'; return p1; } #include #include char *str_cat(char *dest,const char *source) { char *p2 = dest; while(*p2 == '\0'){ p2++; } while(*source){ *p2++ = *source++; } *p = '\0'; return dest; } #include "strcc.h" #include using namespace std; int main(int argc, const char *argv[]) { char p[100]; char py[100] = "hello"; char pc[100] = ",world"; cout





MyStudy_HYB 的學生作業:
#ifndef _COMPUTER_HEAD_H # define _COMPUTER_HEAD_H # include # include using namespace std; class Computer { public: Computer(string category); ~Computer(); string getCategory(void) const; private: string m_category; }; #endif Computer::Computer(string category): m_category(category) { cout




