Click here to Skip to main content
15,867,453 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
QuestionHow does the compiler achieve the CRT remapping? Pin
John Schroedl22-Aug-22 10:50
professionalJohn Schroedl22-Aug-22 10:50 
Question[Solved] I hope there is a Managed C++/CLR person left to help me with Parallel::For Pin
madusmacus27-Jul-22 4:25
madusmacus27-Jul-22 4:25 
AnswerRe: I hope there is a Managed C++/CLR person left to help me with Parallel::For Pin
Richard Deeming27-Jul-22 22:13
mveRichard Deeming27-Jul-22 22:13 
General[Final Code Here] Re: I hope there is a Managed C++/CLR person left to help me with Parallel::For Pin
madusmacus27-Jul-22 22:35
madusmacus27-Jul-22 22:35 
Questionc++ forms 2022 code Pin
Member 884846417-Jun-22 1:37
Member 884846417-Jun-22 1:37 
AnswerRe: c++ forms 2022 code Pin
Richard MacCutchan17-Jun-22 3:56
mveRichard MacCutchan17-Jun-22 3:56 
QuestionI want to write a C++/CLI wrapper class library which can be utilized in both C++ and C# applications. Pin
Member 121624009-Jun-22 21:45
Member 121624009-Jun-22 21:45 
Questionsimplifying code Pin
hshan_15-Mar-22 6:30
hshan_15-Mar-22 6:30 
i could use some tip about simplifying this code:

class Pojazd
{
public:

    virtual void buduj()=0;
};

class Sedan : Pojazd
{
private:
    string typ="Sedan";
public:
    string marka;
    string model;
    int hp;//horse power
    double v;//pojemnosc silnika
    int cena;
    virtual void buduj()
    {
        cout << marka << " " << model << " " << endl;
        cout << "Typ nadwozia: " << typ << endl;
        cout << "Dane Techniczne: " << endl;
        cout << "-" << hp << " KM" << "\n-Silnik: " << v << "L" << endl;
        cout << "Cena " << cena << "\nmiesieczna rata " << cena / 12 << endl;
    }
    Sedan(string nadwozie)
    {
        nadwozie = typ;
    }

};

class Hatchback : Pojazd
{

    string typ;
public:
    string marka;                                             
    string model;
    int hp;//horse power
    double v;//pojemnosc silnika
    int cena;
    virtual void buduj()
    {
        cout << marka << " " << model << " " << endl;
        cout << "Typ nadwozia: " << typ << endl;
        cout << "Dane Techniczne: " << endl;
        cout << "-" << hp << " KM" << "\n-Silnik: " << v << "L" << endl;
        cout << "Cena " << cena << "\nmiesieczna rata " << cena / 12 << endl;
    }
    Hatchback(string typ)
    {
        typ = typ;
    }
};

int main()
{
    w:
    int switch_on;
    cout << "1.Sedan\n2.Hatchback"<<endl;
    cin >> switch_on;
    switch (switch_on)
    {
    case 1:
    {
        cout << "1.Mercedes\n2.BMW\n3.Audi\n";
        cin >> switch_on;
        switch (switch_on)
        {
        case 1:
        {
            Sedan Mercedes("Sedan");
            Mercedes.marka = "Mercedes";
            Mercedes.model = "A klasa";
            Mercedes.hp = 145;
            Mercedes.v = 2.1;
            Mercedes.cena = 156000;

            Sedan* wsk_sedan;
            wsk_sedan = &Mercedes;
            wsk_sedan->buduj();

        }
        case 2:
        {
            Sedan BMW("Sedan");
            BMW.marka = "BMW";
            BMW.model = "d531i";
            BMW.hp = 166;
            BMW.v = 2.5;
            BMW.cena = 188770;

            Sedan* wsk_sedan;
            wsk_sedan = &BMW;
            wsk_sedan->buduj();
        }
         
        }
    
}
        break;
    case 2:
    {
        
    }
        break;
    }
    

   
    

    return 0;
}


i could continue with constructing this switch case tree sort of thingy
but i'm wondering if i can make it simpler and maybe more like a pro ( Cool | :cool: )
i dont expect ready to go code just some tip/hint so i can find more info myself
AnswerRe: simplifying code Pin
Victor Nijegorodov15-Mar-22 9:22
Victor Nijegorodov15-Mar-22 9:22 
GeneralRe: simplifying code Pin
Ghazi Warrior22-Mar-22 19:46
Ghazi Warrior22-Mar-22 19:46 
GeneralRe: simplifying code Pin
hshan_19-Apr-22 3:35
hshan_19-Apr-22 3:35 
AnswerRe: simplifying code Pin
Craig Robbins15-Mar-22 9:25
Craig Robbins15-Mar-22 9:25 
QuestionConvert From C# To Visual C++ 2015 Pin
Paramu197313-Dec-21 20:21
Paramu197313-Dec-21 20:21 
Rant[REPOST] Convert From C# To Visual C++ 2015 Pin
Richard Deeming13-Dec-21 21:56
mveRichard Deeming13-Dec-21 21:56 
GeneralRe: [REPOST] Convert From C# To Visual C++ 2015 Pin
Paramu197316-Dec-21 21:14
Paramu197316-Dec-21 21:14 
AnswerRe: Convert From C# To Visual C++ 2015 Pin
Richard MacCutchan13-Dec-21 21:58
mveRichard MacCutchan13-Dec-21 21:58 
GeneralRe: Convert From C# To Visual C++ 2015 Pin
Paramu197316-Dec-21 21:35
Paramu197316-Dec-21 21:35 
AnswerRe: Convert From C# To Visual C++ 2015 Pin
Dave Kreskowiak14-Dec-21 5:05
mveDave Kreskowiak14-Dec-21 5:05 
QuestionopenFileDialog - AccessViolationException was unhandled Pin
Paramu19734-Oct-21 12:28
Paramu19734-Oct-21 12:28 
AnswerRe: openFileDialog - AccessViolationException was unhandled Pin
Victor Nijegorodov5-Oct-21 21:26
Victor Nijegorodov5-Oct-21 21:26 
GeneralRe: openFileDialog - AccessViolationException was unhandled Pin
Paramu19736-Oct-21 3:17
Paramu19736-Oct-21 3:17 
QuestionConvert/cast System::Array class to List Pin
yehiga146710-Jun-21 17:51
yehiga146710-Jun-21 17:51 
AnswerRe: Convert/cast System::Array class to List Pin
Victor Nijegorodov10-Jun-21 20:27
Victor Nijegorodov10-Jun-21 20:27 
AnswerRe: Convert/cast System::Array class to List Pin
Richard Andrew x6427-Jun-21 6:52
professionalRichard Andrew x6427-Jun-21 6:52 
QuestionC# and c++/cli problem on x86 OS Pin
Duc Axenn30-May-21 10:25
Duc Axenn30-May-21 10:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.