• R/O
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

練習用です。いろんなものがごちゃまぜです。


Commit MetaInfo

Revision42 (tree)
Time2015-09-21 08:57:34
Authorbellyoshi

Log Message

(empty log message)

Change Summary

Incremental Difference

--- TeachYourSelf/samparray5.cpp (nonexistent)
+++ TeachYourSelf/samparray5.cpp (revision 42)
@@ -0,0 +1,30 @@
1+#include <iostream>
2+using namespace std;
3+
4+class samp{
5+ int a,b;
6+public:
7+ samp(int n,int m){a = n;b =m;}
8+ int get_a(){return a;}
9+ int get_b(){return b;}
10+};
11+
12+int main()
13+{
14+ samp ob[4] = {
15+ samp(1,2),
16+ samp(3,4),
17+ samp(5,6),
18+ samp(7,8)};
19+ samp *p;
20+ p = ob;
21+ for(int i = 0; i < 4; i++){
22+ cout << p->get_a() << ' ';
23+ cout << p->get_b() << "\n";
24+ p++;
25+ }
26+
27+ cout << "\n";
28+
29+ return 0;
30+}
\ No newline at end of file