Phau ntawv qhia no yuav qhia koj li cas los hloov C ++ qhov chaws rau hauv EXE cov ntaub ntawv uas tuaj yeem ua haujlwm ntawm feem ntau (yog tias tsis yog txhua) Windows khoos phis tawj. Ntxiv rau C ++, koj tseem tuaj yeem hloov pauv cov cai nrog kev txuas ntxiv.cpp,.cc, thiab.cxx (ntxiv rau.c, txawm hais tias tsis tau lees tias ua tiav) los ntawm kev ua raws cov lus qhia no. Kab lus no kwv yees tias C ++ cov cai yuav khiav ntawm lub console thiab tsis xav tau cov tsev qiv ntawv sab nraud.
Kauj ruam
Kauj Ruam 1. Tau txais dawb C ++ compiler
Ib qho ntawm qhov ua tau zoo tshaj plaws rau lub khoos phis tawj Windows yog Microsoft Visual C ++ 2012 Express, uas tuaj yeem rub tawm dawb.
Kauj Ruam 2. Pib txoj haujlwm tshiab hauv Visual C ++
Koj tuaj yeem tsim txoj haujlwm yooj yim. Nyem rau "New Project" khawm nyob rau sab saud sab laug ntawm lub vijtsam, tom qab ntawd ua raws cov lus qhia rau kev tsim qhov project tsis muaj dab tsi ("Empty Project"). Muab lub npe ua haujlwm, tom qab ntawv nyem "Ua tiav" hauv lub qhov rai tom ntej.
Kauj Ruam 3. Luam thiab muab tag nrho cov ntaub ntawv.cpp tso rau hauv "Cov Ntaub Ntawv Cov Ntaub Ntawv" cov npe, thiab cov ntawv.h (yog tias muaj) rau hauv "Cov Ntawv Cov Ntaub Ntawv" nplaub tshev
Hloov lub ntsiab.cpp cov ntaub ntawv (cov ntaub ntawv nrog "int main ()" txuj ci) nrog lub npe ntawm txoj haujlwm koj tau nkag ua ntej. Txhua qhov kev cia siab rau sab nraud yuav raug sau cia.
Kauj Ruam 4. Tom qab luam cov ntaub ntawv, nthuav tawm thiab suav qhov haujlwm los ntawm nias F7
Visual C ++ yuav tsim koj cov ntaub ntawv program.
Kauj Ruam 5. Nrhiav cov ntawv EXE
Qhib "Cov Haujlwm" nplaub tshev qhov twg Visual C ++ khaws txhua qhov kev pabcuam suav nrog (hauv Windows 7, daim nplaub tshev no nyob hauv "Cov Ntaub Ntawv" nplaub tshev). Koj qhov haujlwm yuav raug cawm nyob hauv qab lub npe project, hauv "Debug" nplaub tshev.
Kauj Ruam 6. Kuaj qhov program los ntawm ob npaug nias cov ntawv
Yog tias tsis muaj qhov yuam kev, koj qhov program yuav ua haujlwm zoo. Yog tias muaj qhov yuam kev tshwm sim, rov ua cov kauj ruam saum toj no.
Kauj Ruam 7. Yog tias koj xav khiav qhov program ntawm lwm lub khoos phis tawj, xyuas kom tseeb tias Visual C ++ Runtime library tau teeb tsa hauv lub khoos phis tawj ntawd
C ++ cov phiaj xwm suav nrog Visual C ++ nyob ntawm Visual C ++ cov tsev qiv ntawv, tab sis koj tsis tas yuav teeb tsa lawv vim tias cov tsev qiv ntawv yuav raug teeb tsa tom qab txhim kho Visual Studio. Txawm li cas los xij, tus neeg ua haujlwm rau koj txoj haujlwm tsis tas yuav muaj lub tsev qiv ntawv. Rub tawm Visual C ++ lub tsev qiv ntawv ntawm
Lub tswv yim
- Qee zaum, qhov ua yuam kev tshwm sim vim qhov kev zov me nyuam cov kws sau ntawv siv txoj kev tsis pom zoo lossis tsis suav nrog kev vam khom hauv qhov chaws.
- Nco ntsoov tias koj teeb tsa Visual C ++ Express hloov tshiab kom tsis txhob cuam tshuam qhov program ua kom yuam kev.
- Feem ntau, nws yooj yim nug tus programmer kom suav sau. Sau koj tus kheej tsuas yog thaum tsim nyog.
Ceeb toom
- Tsis txhob Dev-C ++. Qhov kev zov me nyuam yog cov neeg sau qub, ib txhis hauv lub xeev beta, muaj 340 tus paub tsis raug, thiab tsis tau hloov tshiab rau 5 xyoos. Yog ua tau, siv tus sau/IDE uas tsis yog Dev-C ++.
- Vim tias C ++ thiab C yog cov lus programming qib qis, cov haujlwm uas koj tsim tuaj yeem ua rau koj lub computer puas tsuaj. Txhawm rau txheeb xyuas seb lub program puas tuaj yeem ua rau lub computer puas tsuaj, txheeb xyuas qhov pib ntawm qhov program, thiab nrhiav "#include" WINDOWS.h ". Yog tias koj pom kab no, tsis txhob sau nws. Nug vim li cas tus neeg siv xav tau nkag mus rau Windows programming Yog tias tus neeg siv cov lus teb tsis txaus ntseeg, thov kev pab ntawm lub rooj sib tham.