Forwarded from تجمع بؤساء الهندسة²⁴⁻²³
الهدر شلون نسويه
هذا شيء حلو يصير
نروح لمكان ملف هدر .h
و تكتب
#ifndef اسم.h
انا سميته main
ف يصير
#ifndef main.h
ورا ما تكتب هذا تنطيه enter كبل يطلعلك
#endif
انت تكتب الكود بينهن
يعني
#ifndef main.h
// الكود
#endif
هيج هسه شني الاضافات الي عدنا
بعد ( #ifndef main.h ) نكتب
#define main.h // اسم الهدر .h
و نكتب هذني و نعرفهن حسب الحاجة اي لو لا .
و هنا نحتاجهن حتى ما يخبط الكود
و std لان عدنا cout و تحتاجه
#include <string>
using namespace std;
ف الترتيب يصير
#ifndef main.h // اسم الهدر .h
#define mainh // اسم الهدر .h
#include <string> // حسب الحاجة
using namespace std; // حسب الحاجة
// الكود هنا
#endif
هذا شيء حلو يصير
نروح لمكان ملف هدر .h
و تكتب
#ifndef اسم.h
انا سميته main
ف يصير
#ifndef main.h
ورا ما تكتب هذا تنطيه enter كبل يطلعلك
#endif
انت تكتب الكود بينهن
يعني
#ifndef main.h
// الكود
#endif
هيج هسه شني الاضافات الي عدنا
بعد ( #ifndef main.h ) نكتب
#define main.h // اسم الهدر .h
و نكتب هذني و نعرفهن حسب الحاجة اي لو لا .
و هنا نحتاجهن حتى ما يخبط الكود
و std لان عدنا cout و تحتاجه
#include <string>
using namespace std;
ف الترتيب يصير
#ifndef main.h // اسم الهدر .h
#define mainh // اسم الهدر .h
#include <string> // حسب الحاجة
using namespace std; // حسب الحاجة
// الكود هنا
#endif
❤1
Forwarded from تجمع بؤساء الهندسة²⁴⁻²³
#ifndef main.h // اسم الملف.h
#define mainh // اسم الملف h
#include <string> // حسب الحاجة
using namespace std; // حسب الحاجة + نحتاجه هنا
class bank {
public :
string AccountHolder;
int AccountNumber;
double balance;
void deposit (double amount) {
balance += amount;
}
void withDrawal(double amount) {
if (balance > amount ){
balance -= amount;
}
else {
cout << "balance < amount "<<endl;
}
}
void display (){
cout << "AccountHolder : " << AccountHolder << ", AccountNumber : " << AccountNumber << ", balance : " << balance << endl;
}
};
#endif // main
#define mainh // اسم الملف h
#include <string> // حسب الحاجة
using namespace std; // حسب الحاجة + نحتاجه هنا
class bank {
public :
string AccountHolder;
int AccountNumber;
double balance;
void deposit (double amount) {
balance += amount;
}
void withDrawal(double amount) {
if (balance > amount ){
balance -= amount;
}
else {
cout << "balance < amount "<<endl;
}
}
void display (){
cout << "AccountHolder : " << AccountHolder << ", AccountNumber : " << AccountNumber << ", balance : " << balance << endl;
}
};
#endif // main
❤2