Язык программирования С++

Как загрузить файл.


#include 

int main()
{
	FILE *f = fopen("test.txt", "rw");
	fseek(f, 0, SEEK_END);
	long len = ftell(f);
	fseek(f, 0, SEEK_SET);
	char *buf = new char[len + 1];
	fread(buf, sizeof(char), len, f);
}


Как выйти из программы на MFC.


   void ExitApp()
   {
        // same as double-clicking on main window close box
        ASSERT(AfxGetApp()->m_pMainWnd != NULL);
        AfxGetApp()->m_pMainWnd->SendMessage(WM_CLOSE);
   }

MFC, version 2.5 or later
   void ExitMFCApp()
   {
        // same as double-clicking on main window close box
        ASSERT(AfxGetMainWnd() != NULL);
        AfxGetMainWnd()->SendMessage(WM_CLOSE);
   }