// 13_13-8.cpp : コンソール アプリケーションのエントリ ポイントを定義します。
//

#include "stdafx.h"
#include <iostream>
#include <windows.h>
#include <cctype>

using namespace std;

char *toUprStr(char *s);

int _tmain(int argc, _TCHAR* argv[])
{
	char *pp, cc[] = "abcd";

	pp = toUprStr(cc);
	cout << cc << '\n';
	cout << pp << '\n';
	
	MessageBox(NULL, _T("Check Console Window"), L"MessageBox", MB_OK);

	return 0;
}

char *toUprStr(char *s)	// ポインタの戻り値と引数
{
	static char buf[80];	// staticが必要
	char *p = buf;

	while (*s) {
		*p++ = toupper(*s++);
	}
	*p = '\0';
	return buf;	// 内部確保のbufを返す
}