Thuta Learning
ရှာဖွေရန်
BasicProgrammingbeginner

Get Started (Setup)

စိတ်လျှော့ပါ။ ဒီခန်းကို စာအုပ်လိုမဟုတ်ဘဲ စကားပြောသလိုပဲ၊ နားလည်လွယ်အောင် ရှင်းပါမယ်။

C++ code ကို run လုပ်ဖို့ compiler လိုပါတယ်။ Compiler ဆိုတာ သင်ရေးထားတဲ့ .cpp source code ကို computer နားလည်နိုင်တဲ့ executable program အဖြစ် ပြောင်းပေးတဲ့ tool ပါ။ Online playground နဲ့ စလေ့လာလို့ရပေမယ့် project တည်ဆောက်ချင်လာရင် local setup ကို သိထားတာ အရေးကြီးပါတယ်။

cpp
# Save your file as hello.cpp
# Compile with g++
g++ hello.cpp -o hello

# Run on macOS/Linux
./hello

# Run on Windows PowerShell
.\hello.exe

hello.cpp က source file ဖြစ်ပြီး g++ က compiler ပါ။ -o hello က output program နာမည်ကို hello လို့ သတ်မှတ်ပေးတာဖြစ်ပါတယ်။ Compile ပြီးမှ run လုပ်ရတာက C++ ရဲ့ ပုံမှန် flow ပါ။

You should see
If compile succeeds, your program runs and prints the output from your code.

Info

Windows မှာ MinGW-w64 သို့မဟုတ် Visual Studio Build Tools, macOS မှာ Xcode Command Line Tools, Linux မှာ g++ package ကို သုံးနိုင်ပါတယ်။

ဒီနေရာမှာ လူအများမှားတတ်တယ်

  • Terminal မှာ g++ command မတွေ့ဘူးဆိုရင် compiler install မပြီးသေးတာ သို့မဟုတ် PATH မချိတ်ရသေးတာ ဖြစ်နိုင်ပါတယ်။
Get Started (Setup) | Thuta Learning