Ektb Code - اكتب كود
هل تريد التفاعل مع هذه المساهمة؟ كل ما عليك هو إنشاء حساب جديد ببضع خطوات أو تسجيل الدخول للمتابعة.

اذهب الى الأسفل
ibrahim sherif mohamed
ibrahim sherif mohamed
مبرمج جديد
مبرمج جديد
Posts : 9
Points : 1371
Reputation : 0
Join date : 11/08/2020

[تم الحل]enumeration type function doesn't work Empty [تم الحل]enumeration type function doesn't work

السبت أغسطس 22, 2020 1:27 pm
الكود:
#include <iostream>

using namespace std;

flowerType readIn();


int main()
{
    enum flowerType {ROSE, DAISY, CARNATION, FREESIA};

    readIn ();

    return 0;
}

flowerType readIn()
{
string str;
flowerType flower = 0;
cin >> str;

if (str == "Rose")
 flower = ROSE;
else if (str == "Daisy")
 flower = DAISY;
else if (str == "Carnation")
 flower == CARNATION;
else if (str == "Freesia")
 flower = FREESIA;
else
 cout << "Invalid flower name." << endl;
return flower;
}
ibrahim sherif mohamed
ibrahim sherif mohamed
مبرمج جديد
مبرمج جديد
Posts : 9
Points : 1371
Reputation : 0
Join date : 11/08/2020

[تم الحل]enumeration type function doesn't work Empty رد: [تم الحل]enumeration type function doesn't work

السبت أغسطس 22, 2020 1:31 pm
[تم الحل]enumeration type function doesn't work Captur14
Ektb Code
Ektb Code

Posts : 54
Points : 1615
Reputation : 11
Join date : 05/05/2020
https://ektbcode.ahlamontada.com

[تم الحل]enumeration type function doesn't work Empty رد: [تم الحل]enumeration type function doesn't work

الثلاثاء أغسطس 25, 2020 9:57 pm
حضرتك معرف enum داخل main وده مينفعش.. عرفها فوق
ibrahim sherif mohamed
ibrahim sherif mohamed
مبرمج جديد
مبرمج جديد
Posts : 9
Points : 1371
Reputation : 0
Join date : 11/08/2020

[تم الحل]enumeration type function doesn't work Empty رد: [تم الحل]enumeration type function doesn't work

الثلاثاء سبتمبر 01, 2020 4:43 pm
تم الحل, شكرا
الرجوع الى أعلى الصفحة
صلاحيات هذا المنتدى:
لاتستطيع الرد على المواضيع في هذا المنتدى