Arkadaşlar öncelikle merhaba. Okul projem için bir otomasyon ödevim var. Bende ezca deposu ilaç kayıt otomasyonunu seçtim. Fakat kodumu yazdırmaya çalıştığımda
C:\Users\seref\Desktop\Otomasyon\Makefile.win [Build Error] [main.o] Error -1073741819
diye birşey çıkıyor. Aşağı tarafta bunu nasıl düzeltebilirim? Yardımınızı bekliyorum. Kodum aşağıdadır.
C++:
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
using namespace std;
struct Ilac {
string ad;
string uretici;
string barkod;
int stok;
};
vector<Ilac> ilacListesi;
void IlacKaydet(Ilac ilac) {
ilacListesi.push_back(ilac);
cout << "İlaç kaydedildi." << endl;
}
void IlacAra(string barkod) {
for (const auto& ilac : ilacListesi) {
if (ilac.barkod == barkod) {
cout << "İlaç bulundu:" << endl;
cout << "Ad: " << ilac.ad << endl;
cout << "Üretici: " << ilac.uretici << endl;
cout << "Barkod: " << ilac.barkod << endl;
cout << "Stok miktarı: " << ilac.stok << endl;
return;
}
}
cout << "İlaç bulunamadı." << endl;
}
void IlacListele() {
for (const auto& ilac : ilacListesi) {
cout << "Ad: " << ilac.ad << endl;
cout << "Üretici: " << ilac.uretici << endl;
cout << "Barkod: " << ilac.barkod << endl;
cout << "Stok miktarı: " << ilac.stok << endl;
cout << "-------------------------" << endl;
}
}
void IlacDuzenle(string barkod) {
for (auto& ilac : ilacListesi) {
if (ilac.barkod == barkod) {
cout << "Yeni ilaç adı: ";
cin >> ilac.ad;
cout << "Yeni üretici: ";
cin >> ilac.uretici;
cout << "Yeni barkod: ";
cin >> ilac.barkod;
cout << "Yeni stok miktarı: ";
cin >> ilac.stok;
cout << "İlaç düzenlendi." << endl;
return;
}
}
cout << "İlaç bulunamadı." << endl;
}
void IlacSil(string barkod) {
for (auto it = ilacListesi.begin(); it != ilacListesi.end(); ++it) {
if (it->barkod == barkod) {
ilacListesi.erase(it);
cout << "İlaç silindi." << endl;
return;
}
}
cout << "İlaç bulunamadı." << endl;
}
void DosyayaKaydet() {
ofstream dosya("ilac_kayitlar.txt");
if (dosya.is_open()) {
for (const auto& ilac : ilacListesi) {
dosya << ilac.ad << "," << ilac.uretici <<
Son düzenleyen: Moderatör: