2016-09-03から1日間の記事一覧

C++メモ書き 参照仮引数

参考書の練習問題にて、プログラムの間違いを指摘して参照型仮引数を使って修正を行えとのこと(元のとは一部変えてあります) #include<iostream> #include<cstdlib> #include<cstring> using namespace std; class strtype{ char *p; int l; public: strtype(char *s); ~strtype(){free(p</cstring></cstdlib></iostream>…