C++の使用禁止Cネイティブ機能だけ

クラスの概念がないと不便なので Cで似たようなことをすればいいと思って。。

思いついた擬似クラスの様なものをメモメモ


#include <stdio.h>

/* 擬似クラス */
struct Stest
{
	void (*out)();
};

/* 擬似メンバ関数 */
void out()
{
	printf("TEST\n");
}
/* 擬似コンストラクタ */
void stest(Stest* _Src)
{
	_Src->out = out;
}

void main()
{
	Stest st;
	stest(&st);    /* 手動コンストラクタ */

	st.out();
}

投稿者:

「C++の使用禁止Cネイティブ機能だけ」への6件のフィードバック

  1. Thanks for the tips about credit repair on your site. The thing I would advice people would be to give up the particular mentality they can buy today and pay later. As being a society most of us tend to repeat this for many factors. This includes getaways, furniture, and also items we would like. However, you should separate the wants from all the needs. When you are working to improve your credit score actually you need some trade-offs. For example you may shop online to save money or you can go to second hand shops instead of highly-priced department stores to get clothing.

  2. hello there and thank you for your info – I have certainly picked up anything new from right here. I did however expertise some technical issues using this web site, since I experienced to reload the web site many times previous to I could get it to load correctly. I had been wondering if your web host is OK? Not that I’m complaining, but slow loading instances times will very frequently affect your placement in google and can damage your high-quality score if ads and marketing with Adwords. Well I’m adding this RSS to my e-mail and can look out for much more of your respective fascinating content. Ensure that you update this again very soon..

  3. ピンバック: Loch Lomond Lodge
  4. Hei excellent story
    Does some one know are there cheaper text message marketing services for shops&stores @ California than 12stores.com? They only cost $9 per thirty days which is not much, nonetheless… Ive to offer five more choices 4 my client. :>

コメントを残す

メールアドレスが公開されることはありません。