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

Managed C++/CLI

 
GeneralRe: pin_ptr versus interior_ptr Pin
John Schroedl1-Nov-16 1:58
professionalJohn Schroedl1-Nov-16 1:58 
QuestionIs it possible to create something invisible to a human eye Pin
MCSIDevelopers18-Aug-16 10:39
MCSIDevelopers18-Aug-16 10:39 
AnswerRe: Is it possible to create something invisible to a human eye Pin
Richard MacCutchan18-Aug-16 22:29
mveRichard MacCutchan18-Aug-16 22:29 
GeneralRe: Is it possible to create something invisible to a human eye Pin
MCSIDevelopers19-Aug-16 1:43
MCSIDevelopers19-Aug-16 1:43 
GeneralRe: Is it possible to create something invisible to a human eye Pin
Richard MacCutchan19-Aug-16 1:57
mveRichard MacCutchan19-Aug-16 1:57 
GeneralRe: Is it possible to create something invisible to a human eye Pin
MCSIDevelopers20-Aug-16 12:46
MCSIDevelopers20-Aug-16 12:46 
GeneralRe: Is it possible to create something invisible to a human eye Pin
Richard MacCutchan20-Aug-16 20:41
mveRichard MacCutchan20-Aug-16 20:41 
QuestionString concatenation using operator overloading Pin
kinderu4-Aug-16 0:32
kinderu4-Aug-16 0:32 
I have the following program and I am trying to do the conactenation of two strings using overloading operator "+", but I am getting error in function "String operator+ (String box)" and line "box4 = box1 + box2".
Why doesn't show my string concatenated ?

C++
#include <iostream>
#include <cstring>
using namespace std;

class String
{
public:
    char *sir;
    String()
    {
        cout << "\n String() default called." << endl;
    }
    String(char *sir)
    {
        cout << "\n String() parameter called." << endl;
        if (this->sir != NULL)
            delete this->sir;
        this->sir = new char[strlen(sir)+1];
        strcpy(this->sir, sir);
    }
    String(String &box)
    {
        cout << "\n String() copy constructor called." << endl;
        this->sir = new char[strlen(box.sir)+1];
        strcpy(this->sir, box.sir);
    }
    void setString(char *sir)
    {
        cout << "\n setString() called." << endl;
        this->sir = sir;
    }
    char *getString()
    {
        return sir;
    }
    String operator=(String box)
    {
        cout << "\n String() Assigment operator called." << endl;
        String temp;
        strcpy(temp.sir, sir);
        strcat(temp.sir, box.sir);
        return temp;
    }
    String operator+ (String box)
    {
        String temp;
        strcpy (temp.sir, sir);
        strcat (temp.sir, box.sir);
        return temp;
    }
};

int main()
{
    String box1;
    box1.setString("Geeksforgeeks");
    cout << "\n Box1::sir: " << box1.getString() << endl;
    String box2;
    box2.setString("GeeksQuiz");
    cout << "\n Box2::sir: " << box2.getString() << endl;
    box1 = box2;
    cout << "\n Box1::sir: " << box1.getString() << endl;
    String box3 = box2;
    cout << "\n Box3::sir: " << box3.getString() << endl;
    String box4;
    box4 = box1 + box2;
    cout << "\n Box4::sir: " << box4.getString() << endl;
    return 0;
}


modified 4-Aug-16 13:21pm.

QuestionRe: String concatenation using operator overloading Pin
Richard MacCutchan4-Aug-16 1:17
mveRichard MacCutchan4-Aug-16 1:17 
AnswerRe: String concatenation using operator overloading Pin
KarstenK29-Nov-16 5:58
mveKarstenK29-Nov-16 5:58 
QuestionNeed help with managed C++ dll so unmanaged C++ program can use third party c# dll Pin
garyflet18-Jul-16 10:46
garyflet18-Jul-16 10:46 
AnswerRe: Need help with managed C++ dll so unmanaged C++ program can use third party c# dll Pin
garyflet19-Jul-16 5:58
garyflet19-Jul-16 5:58 
QuestionInheritance classes Pin
kinderu16-Jul-16 10:10
kinderu16-Jul-16 10:10 
AnswerRe: Inheritance classes Pin
Richard MacCutchan16-Jul-16 21:18
mveRichard MacCutchan16-Jul-16 21:18 
Questionextract audio from video Pin
Member 1223658412-Jul-16 2:38
Member 1223658412-Jul-16 2:38 
AnswerRe: extract audio from video Pin
Richard MacCutchan12-Jul-16 5:28
mveRichard MacCutchan12-Jul-16 5:28 
QuestionIn Microsoft Visual C++ how to use sub threads to achieve similar CListCtrl ? Pin
zhaoshan313@163.com29-Jun-16 3:50
zhaoshan313@163.com29-Jun-16 3:50 
QuestionI need the quick response on the AES code in C++ Pin
Member 1221638017-Jun-16 5:56
Member 1221638017-Jun-16 5:56 
Rant[REPOST] I need the quick response on the AES code in C++ Pin
Richard Deeming17-Jun-16 12:39
mveRichard Deeming17-Jun-16 12:39 
GeneralRe: [REPOST] I need the quick response on the AES code in C++ Pin
Member 1221638018-Jun-16 21:38
Member 1221638018-Jun-16 21:38 
GeneralRe: [REPOST] I need the quick response on the AES code in C++ Pin
Richard MacCutchan19-Jun-16 21:36
mveRichard MacCutchan19-Jun-16 21:36 
GeneralRe: [REPOST] I need the quick response on the AES code in C++ Pin
Member 122163806-Jul-16 3:40
Member 122163806-Jul-16 3:40 
GeneralRe: [REPOST] I need the quick response on the AES code in C++ Pin
Richard MacCutchan6-Jul-16 4:00
mveRichard MacCutchan6-Jul-16 4:00 
AnswerRe: I need the quick response on the AES code in C++ Pin
Taiming J4-Sep-16 23:11
Taiming J4-Sep-16 23:11 
QuestionAES code implementation in C++ Pin
Member 122163806-Jun-16 1:56
Member 122163806-Jun-16 1:56 

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.